Exemplo n.º 1
0
 void Die()
 {
     if (!dead)
     {
         dead = true;
         if (gameObject.tag == "Enemy")
         {
             PickableObject.PickableType dropType;
             if (currentWeapon == 0 || currentWeapon == 1)
             {
                 dropType = PickableObject.PickableType.pistol;
             }
             else if (currentWeapon == 2)
             {
                 dropType = PickableObject.PickableType.shotgun;
             }
             else if (currentWeapon == 3)
             {
                 dropType = PickableObject.PickableType.rifle;
             }
             else
             {
                 dropType = PickableObject.PickableType.booze;
             }
             DropManager.DropAt(dropType, this.transform.position);
         }
         if (gameObject.tag == "Player")
         {
             GameManager.Restart();
         }
         if (deadBody != null)
         {
             deadBody.SetActive(true);
             deadBody.transform.parent = this.transform.parent;
         }
         this.gameObject.SetActive(false);
     }
 }