Esempio n. 1
0
 public void takeDamage(int damage)
 {
     if (dead == false)
     {
         health -= damage;
         if (health <= 0)
         {
             stuff.canMove = false;
             manager.AddScore(type);
             if (type == "Escaped")
             {
                 Destroy(this.gameObject);
             }
             else
             {
                 mouth.Stop();
                 mouth.clip = manager.returnDeath(type);
                 mouth.Play();
                 mouth.loop = false;
                 StartCoroutine("waitForCry");
             }
             dead = true;
         }
     }
 }