public void onCollide(GameObject collidedObject)
 {
     if (GetHealth() != null && collidedObject.GetComponent <DamageAble>() != null)
     {
         DamageAble damageAble = collidedObject.GetComponent <DamageAble>();
         GetHealth().ReduceHealth(damageAble.GetDamage());
         if (GetHealth().IsDie())
         {
             Die(collidedObject);
         }
     }
 }
 public void onCollide(GameObject collidedObj)
 {
     if (collidedObj.GetComponent <DamageAble>())
     {
         DamageAble damage = collidedObj.GetComponent <DamageAble>();
         GetPlayerHealth().ReduceHealth(damage.GetDamage());
         if (GetPlayerHealth().IsDie())
         {
             PlayerDie();
         }
     }
 }
Beispiel #3
0
 public void onCollide(GameObject colidedObj)
 {
     if (colidedObj.GetComponent <DamageAble>())
     {
         DamageAble damage = colidedObj.GetComponent <DamageAble>();
         if (_health != null)
         {
             _health.ReduceHealth(damage.GetDamage());
             ChangeAlpha();
             if (_health.IsDie())
             {
                 DestroySchild();
             }
         }
     }
 }