Ejemplo n.º 1
0
        //Called during GameController.Destroy();
        private void GameController_OnDestroying(GameController instance)
        {
            Debug.Log("GameController.Destroy()");

            GameController.OnDestroying -= GameController_OnDestroying;

            AudioController.Destroy();
            InputController.Destroy();
            ResourceController.Destroy();
            TickController.Destroy();
            ViewController.Destroy();
            _unpausableUpdateSystems.DeactivateReactiveSystems();

            Pools.pool.Reset();
            DestroyPoolObserver();

            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        }
Ejemplo n.º 2
0
        //Called during GameController.Destroy();
        private void GameController_OnDestroying(GameController instance)
        {
            Debug.Log("GameController.Destroy()");

            GameController.OnDestroying -= GameController_OnDestroying;

            if (AudioController.IsInstantiated())
            {
                AudioController.Destroy();
            }
            if (InputController.IsInstantiated())
            {
                InputController.Destroy();
            }
            if (ViewController.IsInstantiated())
            {
                ViewController.Destroy();
            }
            if (TickController.IsInstantiated())
            {
                TickController.Destroy();
            }
            if (ResourceController.IsInstantiated())
            {
                ResourceController.Destroy();
            }


            _pausableUpdateSystems.DeactivateReactiveSystems();
            _unpausableUpdateSystems.DeactivateReactiveSystems();

            Pools.pool.Reset();
            DestroyPoolObserver();

            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        }