コード例 #1
0
 public void Damage(int damage)
 {
     hp -= damage;
     if (hp <= 0)
     {
         Debug.Log("Dead");
         if (ragdoll != null)
         {
             Transform t = Instantiate(ragdoll, transform.position, transform.rotation).transform;
             t.parent = transform.parent;
         }
         if (dcont != null)
         {
             dcont.spawn_chest();
         }
         Destroy(gameObject);
     }
 }