Example #1
0
        void SpawnEnemy()
        {
            if (enemyCooldown > 0)
            {
                return;
            }

            EnemyBasicController e = Instantiate(minion, enemySpawner.transform.position, Quaternion.identity);

            minion.attackTarget = attackTarget;
            minion.nav.SetDestination(minion.attackTarget.transform.position);

            currentEnemies++;
            enemyCooldown = 1 / enemiesPerSecond;
        }
Example #2
0
        private void OnTriggerEnter(Collider other)
        {
            EnemyBasicController baddie = other.GetComponent <EnemyBasicController>();

            //EnemyBossController boss = other.GetComponent<EnemyBossController>();

            if (baddie.health > 0)
            {
                baddie.health -= 10;
            }
            // if (boss.health > 0) boss.health -= 10;



            Destroy(gameObject);
        }
 virtual public void OnStart(EnemyBasicController enemy)
 {
     this.enemy = enemy;
 }