Ejemplo n.º 1
0
			private static void CreateWave(CreepWave wave, WaveGenerator waveGenerator)
			{
				if (creepCountForCurrentWave >= wave.TotalCreepsInWave)
				{
					creepCountForCurrentWave = 0;
					waveGenerator.waveList.RemoveAt(0);
					waveGenerator.level.UpdateWave();
					return;
				}
				if (!Time.CheckEvery(wave.SpawnInterval))
					return;
				SpawnNextItemFromList(wave.CreepsAndGroupsList[0], waveGenerator);
			}
Ejemplo n.º 2
0
			private static void SpawnNextItemFromList(object itemInWaveList, WaveGenerator waveGenerator)
			{
				if (IsItemCreep(itemInWaveList))
				{
					if (waveGenerator.spawnPoint == default(Vector3D))
						waveGenerator.level.SpawnCreep((CreepType)itemInWaveList);
					else
						new Creep((CreepType)itemInWaveList, waveGenerator.spawnPoint);
					creepCountForCurrentWave++;
					waveGenerator.waveList[0].CreepsAndGroupsList.RemoveAt(0);
				}
				else if (IsItemGroup(itemInWaveList))
				{
					if (!waveGenerator.Contains<SpawnAllCreepsInGroup>())
						waveGenerator.Start<SpawnAllCreepsInGroup>();
					waveGenerator.Stop<WaveCreation>();
				}
			}
Ejemplo n.º 3
0
				private void UpdateCreepCountAndStopCurrentBehavior(WaveGenerator waveGenerator)
				{
					creepCountForCurrentWave += creepCount;
					creepsSpawnedFromCurrentGroup = 0;
					waveGenerator.Start<WaveCreation>();
					waveGenerator.waveList[0].CreepsAndGroupsList.RemoveAt(0);
					waveGenerator.Stop<SpawnAllCreepsInGroup>();
				}
Ejemplo n.º 4
0
				private void SpawnCreepsFromGroup(WaveGenerator waveGenerator)
				{
					var wave = waveGenerator.waveList[0];
					if (creepsSpawnedFromCurrentGroup >= creepCount)
					{
						UpdateCreepCountAndStopCurrentBehavior(waveGenerator);
						return;
					}
					var groupData = (GroupData)wave.CreepsAndGroupsList[0];
					if (!Time.CheckEvery(groupData.CreepSpawnInterval))
						return;
					waveGenerator.level.SpawnCreep(groupData.CreepList[0]);
					groupData.CreepList.RemoveAt(0);
					creepsSpawnedFromCurrentGroup++;
				}