Ejemplo n.º 1
0
        private static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
        {
            if (scene.name == "Main")
            {
                Init();
                Instance.gameObject.AddIfNeedComponent <AlwaysDayConsoleCommand>();
                Instance.gameObject.AddIfNeedComponent <OverPowerConsoleCommand>();
            }
            else if (scene.name == "StartScreen")
            {
                // DisplayManager.OnDisplayChanged += OnDisplayChanged;

                if (isInfoBarEnabled)
                {
                    CmInfoBar = new CM_InfoBar();
                }

                if (isConsoleEnabled)
                {
                    CmLogger = new CM_Logger();
                }

                CmConfig.Load();
            }
        }
Ejemplo n.º 2
0
 public void Awake()
 {
     Instance     = this;
     useGUILayout = false;
     DontDestroyOnLoad(this);
     drawRect = new Rect(windowRect.x + 5, windowRect.y, windowRect.width, windowRect.height);
     isShow   = true;
 }
Ejemplo n.º 3
0
        public CM_InfoBar()
        {
            if (Instance == null)
            {
                Instance = FindObjectOfType(typeof(CM_InfoBar)) as CM_InfoBar;

                if (Instance == null)
                {
                    GameObject cm_infobar = new GameObject().AddComponent <CM_InfoBar>().gameObject;
                    cm_infobar.name = "CM_InfoBar";
                    Instance        = cm_infobar.GetComponent <CM_InfoBar>();
                }
            }
        }