예제 #1
0
    void Update()
    {
        if (this.startCounter)
        {
            if (timer >= incrementTime)
            {
                if (this.incrementEnemies < behave.enemiesKilled)
                {
                    this.incrementEnemies++;
                    this.enemiesKilled.text = this.incrementEnemies.ToString();
                    this.incrementCoins    += this.coinsPerEnemy;
                    this.coinsEarned.text   = this.incrementCoins.ToString();


                    //instanciar cabeca de inimigo;
                    var imageAux = GameBehavior.Instantiate(enemyImage);
                    imageAux.transform.SetParent(heads.transform);
                    audioCoin.Play();

                    timer = 0;
                }
                else
                {
                    this.startCounter     = false;
                    this.coinsEarned.text = behave.getEarnedCoins().ToString();
                }
            }
            else
            {
                timer += Time.deltaTime;
            }
        }
    }