Ejemplo n.º 1
0
 public void SetWave(int waveIndex)
 {
     this.waveIndex  = waveIndex;
     this.mSpawnCD   = 0;
     this.spawnIndex = 0;
     tableGameWave   = TableGameWave.Get(tableGameLevel.waveID[waveIndex]);
 }
Ejemplo n.º 2
0
        private void UpdateProgress()
        {
            int total        = 0;
            int spawnedTotal = mWaveModule.spawnIndex;

            for (int i = 0; i < mTableGameLevel.waveID.Length; i++)
            {
                var configWave = TableGameWave.Get(mTableGameLevel.waveID[i]);
                var waveCount  = (int)(configWave.spawnCount * mSpawnCountFix * mTableGameLevel.spawnCountFactor);
                total += waveCount;
                if (mWaveModule.waveIndex > i)
                {
                    spawnedTotal += waveCount;
                }
            }
            float killed = spawnedTotal - EntityManager.Count <VirusBase>(a => a.isMatrix) - EntityManager.Count <VirusBase>(a => !a.isMatrix) * 0.5f;
            float _p     = Mathf.Clamp01(1f * killed / total);

            if (_p > progress)
            {
                progress = _p;
            }
        }