Entitas.Systems.DeactivateReactiveSystems C# (CSharp) Method

DeactivateReactiveSystems() public method

public DeactivateReactiveSystems ( ) : void
return void
        public virtual void DeactivateReactiveSystems()
        {
            for (int i = 0; i < _executeSystems.Count; i++) {
                var system = _executeSystems[i];
                var reactiveSystem = system as ReactiveSystem;
                if(reactiveSystem != null) {
                    reactiveSystem.Deactivate();
                }

                var nestedSystems = system as Systems;
                if(nestedSystems != null) {
                    nestedSystems.DeactivateReactiveSystems();
                }
            }
        }

Usage Example

Example #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);
        }
All Usage Examples Of Entitas.Systems::DeactivateReactiveSystems