Beispiel #1
0
        /// <summary>
        /// Apply chosen EnemyWave setting to SpawnPoints.
        /// </summary>
        /// <param name="points"></param>
        /// <param name="set"></param>
        /// <returns></returns>
        private bool ApplySettingToSpawnPoints(SpawnPoint[] points, EnemyWave set)
        {
            var e = points;

            //Refresh
            foreach (SpawnPoint p in e)
            {
                p.enemys      = new List <SpawnSequence>();
                p.hordeTag    = set.tag;
                p.spawnBuffer = set.delay;
                p.spawnEffect = set.effect;
            }

            //Push data point by point a round, then next data again
            //X = points[i] : Y = points[i].enemys.Add()
            //#0 : X1Y1 => X2Y1 => X3Y1
            //#1 : X1Y2 => X2Y2 => X3Y2
            for (int y = 0; y < set.enemys.Count; y++)
            {
                int   total = set.enemys[y].number;
                int[] feed  = GetSeparatedFeed(total, points.Length);

                for (int x = 0; x < points.Length; x++)
                {
                    e[x].enemys.Add(new SpawnSequence(set.enemys[y].prefab, feed[x]));
                }
            }
            return(true);
        }
Beispiel #2
0
 public EnemyWave(EnemyWave clone)
 {
     this.tag = clone.tag;
     SpawnSequence[] array = new SpawnSequence[clone.enemys.Count];
     for (int i = 0; i < clone.enemys.Count; i++)
     {
         array[i] = new SpawnSequence(clone.enemys[i]);
     }
     this.enemys = array.ToList();
     this.delay  = clone.delay;
     this.effect = clone.effect;
 }
Beispiel #3
0
 public void Override(EnemyWaveSet clone)
 {
     this.name   = clone.name;
     this.wave   = new EnemyWave(clone.wave);
     this.chance = clone.chance;
 }
Beispiel #4
0
 public EnemyWaveSet(EnemyWaveSet clone)
 {
     this.name   = clone.name;
     this.wave   = new EnemyWave(clone.wave);
     this.chance = clone.chance;
 }