protected void Awake()
        {
            if (Current == null)
            {
                Current = this;
            }
            else
            {
                Debug.Log("There are multiple Levelcontrollers in the scene");
            }

            if (_hostileSpawner == null)
            {
                Debug.Log("No Reference: Hostile Spawner");
                _hostileSpawner = GetComponentInChildren <Spawner>();
            }
            if (_PlayerSpawner == null)
            {
                Debug.Log("No Reference: Player Spawner");
                _PlayerSpawner = GetComponentInChildren <PlayerSpawner>();
            }
            if (_powerUpSpawn == null)
            {
                Debug.Log("No Reference: PowerUp Spawner");
                _powerUpSpawn = GetComponentInChildren <PowerUpSpawner>();
            }
        }
Esempio n. 2
0
        protected void Awake()
        {
            if (Current == null)
            {
                Current = this;
            }
            else
            {
                Debug.LogError("There are multiple LevelControllers in the scene!");
            }

            if (_enemySpawner == null)
            {
                Debug.Log("No reference to an enemy spawner.");
                //_enemySpawner = GameObject.FindObjectOfType<Spawner>();
                _enemySpawner = GetComponentInChildren <Spawner>();
            }

            if (_playerSpawner == null)
            {
                Debug.Log("No reference to a player spawner.");

                _playerSpawner = GetComponentInChildren <PlayerSpawner>();
            }
        }
        protected override void Awake()
        {
            base.Awake();

            _respawner = GetComponentInParent <PlayerSpawner>();
        }