Ejemplo n.º 1
0
 /// <summary>
 /// Attachs a wave profile to the current enemy spawner.
 /// </summary>
 /// <param name="toAttach">To attach.</param>
 public void attachProfile(WaveProfile toAttach)
 {
     spawnDistance  = toAttach.spawnDistance;
     spanwFrequency = toAttach.spanwFrequency;
     spawnFor       = toAttach.spawnFor;
     whatToSpawn    = toAttach.whatToSpawn;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Commenses a horde of invaders.
 /// </summary>
 void CommenseHorde()
 {
     if (waveProfiles.waves != null && waveProfiles.waves.Count > 0 && currentWaveNumber < waveProfiles.waves.Count)
     {
         waves.Add(gameObject.AddComponent(typeof(EnemySpawner)) as EnemySpawner);
         WaveProfile currentProfile = waveProfiles.waves [currentWaveNumber];
         waves [currentWaveNumber].enabled = true;
         waves [currentWaveNumber].attachProfile(currentProfile);
         waves [currentWaveNumber].target = hordesTargeting;
         waves [currentWaveNumber].id     = currentWaveNumber;
         currentWaveNumber++;
     }
     else
     {
         this.enabled = false;
     }
 }
Ejemplo n.º 3
0
 public EnemySpawner(WaveProfile toAttach)
 {
     attachProfile(toAttach);
 }