/// <summary> /// Awakeメッセージ /// </summary> private void Awake() { // 複数存在していてはいけない Assert.IsNull(instance, "BaseGameManager is already created! Type: " + GetType().Name); instance = this; }
/// <summary> /// Startイベント /// GameManagerの初期化が終わるまで待機 /// </summary> /// <returns></returns> private IEnumerator Start() { DebugUtility.LogEditor(GetType().Name + " is initializing ..."); // 初期化が完了するまで無効化 enabled = false; // GameManagerの初期化待ち while (!BaseGameManager.IsInitialized()) { yield return(null); } // オブジェクト固有の初期化 yield return(OnStart()); // 初期化が完了したので有効化 enabled = true; DebugUtility.LogEditor(GetType().Name + " is initialized."); yield break; }
/// <summary> /// OnDestroyメッセージ /// </summary> private void OnDestroy() { Terminate(); instance = null; }