private static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (scene.name == "Main") { if (Instance == null) { Instance = CheatManagerGO.AddComponent <CheatManager>(); } } if (scene.name == "StartScreen") { if (!CheatManagerGO) { CheatManagerGO = new GameObject("CheatManagerGO"); } if (CmConfig.isInfoBarEnabled && CmInfoBar == null) { CmInfoBar = CheatManagerGO.AddComponent <CmInfoBar>(); } if (CmConfig.isConsoleEnabled && CmLogger == null) { CmLogger = CheatManagerGO.AddComponent <CmLogger>(); } new CmConfigCommand(); } }
public void Awake() { Instance = this; useGUILayout = false; DontDestroyOnLoad(this); drawRect = new Rect(windowRect.x + 5, windowRect.y, windowRect.width, windowRect.height); isShow = true; }