Пример #1
0
    private void OnEnable()
    {
        //get objets to subscribe to
        levelManager = FindObjectOfType <LevelManager>();
        basis        = FindObjectOfType <BaseCollisionController>();

        //create EnemyWaveController
        waveController = new EnemyWaveController(levelManager.Level.Waves);

        //subscribe to events
        levelManager.SpawnWave                += NewWave;
        basis.HandleEnemyCollision            += EnemyDestroyed;
        EnemyDeathController.HandleEnemyDeath += EnemyDied;
    }
Пример #2
0
 private void Awake()
 {
     currentHealth           = this.totalHealth;
     baseCollisionController = GetComponent <BaseCollisionController>();
     this.healthTreshold     = CalculateHealthThreshold();
 }
Пример #3
0
 private void Awake()
 {
     collisionController = GetComponent <BaseCollisionController>();
     stateManager        = GetComponent <StateManager>();
 }