Пример #1
0
        private IEnumerator LoadCoroutine()
        {
            yield return(new WaitUntil(() => GameObject.FindObjectsOfType <EventManager>() != null));

            eventManagers   = GameObject.FindObjectsOfType <EventManager>();
            pauseController = GameObject.FindObjectOfType <PauseController>();
            onPausePressed += Pause;
            BetterFPFC.Load();
        }
Пример #2
0
        private void OnDestroy()
        {
            SaveCameraState();
            GameObject.Destroy(camera);
            Camera oldMainCamera = GameObject.Find("MainCamera").GetComponent <Camera>();

            oldMainCamera.enabled = true;
            Logger.log?.Debug($"{name}: OnDestroy()");
            instance = null;
        }
Пример #3
0
 private void Awake()
 {
     if (instance != null)
     {
         Logger.log?.Warn($"Instance of {this.GetType().Name} already exists, destroying.");
         GameObject.DestroyImmediate(this);
         return;
     }
     GameObject.DontDestroyOnLoad(this);
     instance = this;
     Logger.log?.Debug($"{name}: Awake()");
 }