示例#1
0
 protected override void GetDamage(float damage)
 {
     base.GetDamage(damage);
     if (_hp <= 0)
     {
         for (int i = 0; i < _data.Count; i++)
         {
             var spawnedEnemy = new SpawnedEnemy();
             spawnedEnemy.Spawn(_enemyObject.transform.position);
         }
     }
 }
示例#2
0
        private void SpawnNextEnemy()
        {
            var       enemySpawnData = _enemiesToSpawnQueue.Dequeue();
            BaseEnemy enemy          = null;

            switch (enemySpawnData.EnemyType)
            {
            case EnemyType.Simple:
                enemy = new SimpleEnemy();
                break;

            case EnemyType.Fast:
                enemy = new FastEnemy();
                break;

            case EnemyType.Slow:
                enemy = new SlowEnemy();
                break;

            case EnemyType.Flying:
                enemy = new FlyingEnemy();
                break;

            case EnemyType.Accelerating:
                enemy = new AcceleratingEnemy();
                break;

            case EnemyType.Invisible:
                enemy = new InvisibleEnemy();
                break;

            case EnemyType.Spawned:
                enemy = new SpawnedEnemy();
                break;

            case EnemyType.Spawning:
                enemy = new SpawningEnemy();
                break;

            case EnemyType.Spiked:
                enemy = new SpikedEnemy();
                break;
            }
            enemy.Spawn(_spawnPoints[enemySpawnData.SpawnPointId]);
        }