예제 #1
0
        protected virtual void Awake()
        {
            _fadeTransitioner = GetComponent<FadeTransitioner>();

            _getReadySequencer = transform.FindChild("Get Ready Sequencer").gameObject;
            _endLevelSequencer = transform.FindChild("End Level Sequencer").gameObject;
            _endLevelSequencerScript = _endLevelSequencer.GetComponent<LevelClearChrome>();
            _gameOverSequencer = transform.FindChild("Game Over Sequencer").gameObject;

            _objectsToUpdateOnNewLifeStart = new List<IChangesStateOnNewLifeStart>();
            _freezableEnemyScripts = new List<ICanBeFrozen>();
            for (int i = 0; i < Enemies.transform.childCount; i++)
            {
                ICanBeFrozen freezableScript = Enemies.transform.GetChild(i).GetComponent<ICanBeFrozen>();
                if (freezableScript != null) { _freezableEnemyScripts.Add(freezableScript); }

                IChangesStateOnNewLifeStart newLifeScript = Enemies.transform.GetChild(i).GetComponent<IChangesStateOnNewLifeStart>();
                if (newLifeScript != null) { _objectsToUpdateOnNewLifeStart.Add(newLifeScript); }
            }

            for (int i=0; i < Switches.transform.childCount; i++)
            {
                IChangesStateOnNewLifeStart newLifeScript = Switches.transform.GetChild(i).GetComponent<IChangesStateOnNewLifeStart>();
                if (newLifeScript != null) { _objectsToUpdateOnNewLifeStart.Add(newLifeScript); }
            }
        }
예제 #2
0
        private void Awake()
        {
            _fadeTransitioner = GetComponent<FadeTransitioner>();
            _playerSequencer = PlayerSequencer.GetComponent<PlayerSequencer>();

            _levelClearSequencer = transform.FindChild("End Level Sequencer").gameObject;

            _freezableEnemyScripts = new List<ICanBeFrozen>();
            for (int i = 0; i < Enemies.transform.childCount; i++)
            {
                ICanBeFrozen freezableScript = Enemies.transform.GetChild(i).GetComponent<ICanBeFrozen>();
                if (freezableScript != null) { _freezableEnemyScripts.Add(freezableScript); }
            }
        }
 private void Awake()
 {
     _fadeTransitioner = GetComponent<FadeTransitioner>();
 }