Unity类银河恶魔城学习记录12-1 p123 UI menu源代码

Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考
此代码仅为较上一P有所改变的代码

【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili

UI.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UI : MonoBehaviour
{

    public void SwitchTo(GameObject _menu)
    {
        for(int i = 0;i < transform.childCount;i++)
        {
            transform.GetChild(i).gameObject.SetActive(false);
        }

        if(_menu != null)
        {
            _menu.SetActive(true);
        }
    }
}

最近更新

  1. TCP协议是安全的吗?

    2024-04-02 22:08:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-02 22:08:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-02 22:08:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-02 22:08:03       20 阅读

热门阅读

  1. 【NOIP2004提高】津津的零花钱

    2024-04-02 22:08:03       15 阅读
  2. 在html页面中引入的element-plusMessage 消息提示用法

    2024-04-02 22:08:03       16 阅读
  3. 外观模式详解:简化复杂系统的“门面”担当

    2024-04-02 22:08:03       15 阅读
  4. Memcached 教程之 Memcached set 命令(五)

    2024-04-02 22:08:03       13 阅读
  5. 2、在Spring Boot中整合MyBatis

    2024-04-02 22:08:03       15 阅读
  6. 出国留学需要多少钱

    2024-04-02 22:08:03       17 阅读