using System.Collections; using System.Collections.Generic; using UnityEngine; public class ModuleManage : MonoBehaviour { private static ModuleManage _instance; public static ModuleManage Instance { get { if (_instance == null) { _instance = FindObjectOfType<ModuleManage>(); } return _instance; } } private ModuleManage() { } public QuestionManage questionManage; public MOCAQuestionManage mOCAQuestionManage; public SceneModelManagr sceneModelManagr; public MOCASceneModelManage mOCASceneModelManage; public GameObject LeftTable; public GameObject RightTable; public GameObject mOCAScoreboard; public GameObject MOCASceneModel; public GameObject Earth; // Start is called before the first frame update void Awake() { Debug.Log(MOCAGlobalData.SkinSceneName); if (MOCAGlobalData.SkinSceneName == "Environment0") { Earth.SetActive(true); } else { Earth.SetActive(false); } LeftTable.SetActive(false); RightTable.SetActive(false); Debug.Log(MOCAGlobalData. CurrentModuleName); if (MOCAGlobalData.CurrentSceneModuleName == "MMSE") { MOCAGlobalData.CurrentModuleName = "MMSE"; questionManage.gameObject.SetActive(true); mOCAQuestionManage.gameObject.SetActive(false); mOCAScoreboard.SetActive(false); MOCASceneModel.SetActive(false); sceneModelManagr.enabled = true; mOCASceneModelManage.enabled = false; } else if (MOCAGlobalData.CurrentSceneModuleName == "MOCA" || MOCAGlobalData.CurrentSceneModuleName == "智能MoCA") { MOCAGlobalData.CurrentModuleName = "MOCA"; questionManage.gameObject.SetActive(false); mOCAQuestionManage.gameObject.SetActive(true); mOCAScoreboard.SetActive(true); MOCASceneModel.SetActive(true); sceneModelManagr.enabled = false; mOCASceneModelManage.enabled = true; } else if (MOCAGlobalData.CurrentSceneModuleName == "SCALE")//SCALE { //混合测试EMCA,首先进入MMSE模块 MOCAGlobalData.CurrentModuleName = "MMSE"; questionManage.gameObject.SetActive(true); mOCAQuestionManage.gameObject.SetActive(false); mOCAScoreboard.SetActive(false); MOCASceneModel.SetActive(false); sceneModelManagr.enabled = true; mOCASceneModelManage.enabled = false; } } // Update is called once per frame void Update() { } }
标签:false,gameObject,unity,单例,SetActive,MOCAGlobalData,true,public From: https://www.cnblogs.com/WalkingSnail/p/18096978