public void Die()
 {
     Destroy(gameObject, 2);
     AudioControl.instance.PlayOneShot(dieSound);
     //Destroy(gameObject);
     Animate.Morrer();
     CheckIfMedKit(porcentagemGeraMeKit);
     scriptUI.AtualizaQtdZUmbisMortos();
     scriptSpawner.DiminuirQtdZumbisVivos();
     Move.Morrer();
     this.enabled = false;
 }
Esempio n. 2
0
    public void Die()
    {
        animBoss.Morrer();
        moveBoss.Morrer();
        AudioControl.instance.PlayOneShot(morre);

        Vector3 posMedKit = RandomPos();

        Instantiate(kitMed, posMedKit, transform.rotation);
        Vector3 posAmmo = RandomPos();

        Instantiate(ammo, posAmmo, transform.rotation);

        Destroy(gameObject, 2);

        scriptUI.AtualizaQtdChefesMortos();

        this.enabled  = false;
        agent.enabled = false; //alem do script é necessario desativar o navmesh, ou ele ira continuar procurando um caminho
        //AudioControl.instance.PlayOneShot(dieSound);
    }