Exemple #1
0
    IEnumerator Dead()
    {
        if (bigEnoughToExplode())
        {
            Instantiate(zombieExplosion, transform.position, Quaternion.identity);
        }
        else
        {
            GetComponent <Animation>().Play("ZombieDead");
            yield return(new WaitForSeconds(GetComponent <Animation>().GetClip("ZombieDead").length));
        }

        Destroy(gameObject);

        CounterUI.Add(1);

        yield return(0);
    }
Exemple #2
0
 public void OnDead()
 {
     fsm.ChangeState((int)state.Dead);
     CounterUI.Add(1);
 }