public GameObject[] ShortWaves; // array of waves prefab objects #endregion // Use this for initialization void Start() { isWaveLoaded = false; numberOfWaves = waves.Length; if (numberOfWaves == 0) { return; } if (!GameSettings.Instance.IsGameLong) { ShortWaves[0].GetComponent <WaveStandard>().WavetimeinSeconds = (waves[0].GetComponent <WaveStandard>().WavetimeinSeconds / 2); ShortWaves[1].GetComponent <WaveStandard>().WavetimeinSeconds = (waves[1].GetComponent <WaveStandard>().WavetimeinSeconds / 2); ShortWaves[2].GetComponent <WaveStandard>().WavetimeinSeconds = (waves[2].GetComponent <WaveStandard>().WavetimeinSeconds / 2); currentWave = Instantiate(ShortWaves[waveNum]); wave = currentWave.GetComponent <IWave>(); isWaveLoaded = true; WS = GetCurrWave(); } else { currentWave = Instantiate(waves[waveNum]); wave = currentWave.GetComponent <IWave>(); isWaveLoaded = true; WS = GetCurrWave(); } }
public void KeepPlaying() { GameIsNotOver_IcanmakeZombies = true; currentWave.GetComponent <WaveStandard>().ResetSpawnStates(); isWaveLoaded = false; Destroy(currentWave); StemKitMNGR.CALL_ResetGunAndMeter(); if (!GameSettings.Instance.IsGameLong) { currentWave = Instantiate(ShortWaves[waveNum]); wave = currentWave.GetComponent <IWave>(); WS = GetCurrWave(); isWaveLoaded = true; TimerBehavior t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(GameSettings.Instance.StartResetWaveIn, ResetWave); t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(GameSettings.Instance.StartWaveAgain, WMStartWave); } else { currentWave = Instantiate(waves[waveNum]); wave = currentWave.GetComponent <IWave>(); WS = GetCurrWave(); isWaveLoaded = true; TimerBehavior t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(GameSettings.Instance.StartResetWaveIn, ResetWave); t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(GameSettings.Instance.StartWaveAgain, WMStartWave); } }
public void Init(WaveStandard wave, float spawnDelay) { m_SpawnDelay = spawnDelay; m_Wave = wave; IsCoolingDown = false; }