Exemplo n.º 1
0
    public void DestroyEnemy()
    {
        enemiesRemaining--;
        UpdateEnemyText();

        if (enemiesRemaining <= 0)
        {
            GameTriggers.OnWaveEnd();

            print("New Wave");
        }
    }
Exemplo n.º 2
0
    public void TakeDamage(float dmg)
    {
        if (!invincible)
        {
            invincible = true;
            print("Player takes damage");
            CurrentHealth--;
            Invoke("ResetInvulnerability", resetTime);

            if (CurrentHealth <= 0)
            {
                GameTriggers.OnWaveEnd();
                //todo kill player gameobject saftley
                //this.gameObject.SetActive(false);
            }
            StartCoroutine(Flash());
        }
    }