bool PrepareNextWave() { GameObject player = GameObject.FindGameObjectWithTag("Player"); if (player.GetComponent <PlayerDetails>().IsDead) { return(false); } if (CurrentWave >= 0) { player.SendMessage("WaveSurvived"); //also start spawning piepl the player has to save from the water PieplSpawner.CurrentWave = CurrentWave++; PieplSpawner.SpawnPiepl(); } if (++CurrentWave >= EnemyWaves.Length || player.GetComponent <PlayerDetails>().IsDead) { // won return(false); } SpawnInterval = EnemyWaves [CurrentWave].SpawnTimeInSeconds / (float)EnemyWaves [CurrentWave].NumDemons; TimeLeftBeforeWaveStarts = EnemyWaves [CurrentWave].StartSpawningDelay; TimeLeftBeforeNextSpawn = 0.0f; NextSpawnVolcanoIndex = 0; NumSpawned = 0; NumSpawnedFlying = 0; return(true); }
// Use this for initialization void Start() { Volcanos = GameObject.FindGameObjectsWithTag(ObjTag_Volcano); PieplSpawner = GetComponent <PieplSpawner> (); CurrentWave = -1; bWaveSpawningActive = PrepareNextWave(); PieplSpawner.CurrentWave = 0; PieplSpawner.SpawnPiepl(); NextWaveStartsText.enabled = false; WaveStartsText.enabled = false; bInvokedWinning = false; }
// Use this for initialization void Start() { Volcanos = GameObject.FindGameObjectsWithTag (ObjTag_Volcano); PieplSpawner = GetComponent<PieplSpawner> (); CurrentWave = -1; bWaveSpawningActive = PrepareNextWave (); PieplSpawner.CurrentWave = 0; PieplSpawner.SpawnPiepl (); NextWaveStartsText.enabled = false; WaveStartsText.enabled = false; bInvokedWinning = false; }