Exemplo n.º 1
0
    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();
        }
    }
Exemplo n.º 2
0
    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);
        }
    }
Exemplo n.º 3
0
 public void Init(WaveStandard wave, float spawnDelay)
 {
     m_SpawnDelay  = spawnDelay;
     m_Wave        = wave;
     IsCoolingDown = false;
 }