Exemplo n.º 1
0
    private void OnDisable()
    {
        //Move to Death() when turrets deal health damage
        CreditBanks Bank = FindObjectOfType <CreditBanks>();

        if (Bank != null)
        {
            Bank.AddCredits(CreditsOnDeath);
        }

        _waveBelongTo = 100;
    }
Exemplo n.º 2
0
    private void SpawnEnemy()
    {
        List <GameObject> tospawnEnemies = new List <GameObject>();

        for (int i = 0; i < _waves[Wave].Spawns.Length; i++)
        {
            int numToSpawn = _waves[Wave].Spawns[i];
            int tospawn    = 0;

            for (int j = 0; j < _pools[i].Num.Length; j++)
            {
                if ((tospawn < numToSpawn) && (_pools[i].Num[j].activeSelf == false))
                {
                    tospawnEnemies.Add(_pools[i].Num[j]);
                    tospawn = tospawn + 1;
                }
            }
        }

        if ((Wave - 1) != -1)
        {
            CreditBanks Bank = FindObjectOfType <CreditBanks>();
            Bank.AddPlayerCredits(_waves[Wave - 1].PlayerCredits);
        }

        Wave          = Wave + 1;
        _waveNum.text = Wave.ToString();

        if (Wave == _waves.Length)
        {
            _waveTimerNum.text = "0.00";

            _finished = true;
        }

        DelayedSpawns(tospawnEnemies);
    }
Exemplo n.º 3
0
    //System
    private void OnEnable()
    {
        CreditBanks Bank = FindObjectOfType <CreditBanks>();

        Bank.MinusCredits(_cost);
    }