Exemplo n.º 1
0
        public ZombieHuman GetZombie(float powerAvailable)
        {
            if (this.zombies.Count <= 0)
            {
                return(null);
            }
            int         balanceNum = this.GetBalanceNum();
            ZombieHuman variant    = this.zombies[balanceNum].GetVariant();

            while ((this.zombies.Count > 0) && ((((GameManager.instance.currentGameMode == GameManager.GameModes.Idle) && !this.zombies[balanceNum].readyInIdle) || ((GameManager.instance.currentGameMode != GameManager.GameModes.Idle) && (this.zombies[balanceNum].minWave > WavesManager.instance.currentWave))) || (variant.power > powerAvailable)))
            {
                this.zombies.RemoveAt(balanceNum);
                this.chances.RemoveAt(balanceNum);
                if (this.zombies.Count <= 0)
                {
                    break;
                }
                balanceNum = this.GetBalanceNum();
                variant    = this.zombies[balanceNum].GetVariant();
            }
            if (this.zombies.Count <= 0)
            {
                return(null);
            }
            return(variant);
        }
Exemplo n.º 2
0
 public void SetPrefabData()
 {
     for (int i = 0; i < this.zombiePrefabs.Length; i++)
     {
         ZombieHuman component = this.zombiePrefabs[i].GetComponent <ZombieHuman>();
         component.zombieType  = this.type;
         component.countHealth = this.health;
         component.damage      = this.damage;
         component.power       = this.power;
     }
 }