Ejemplo n.º 1
0
 protected void Damage(DamageSource damageSource)
 {
     if (isDead)
         return;
     print (damageSource.GetPower () + " damage to enemy");
     hp -= damageSource.GetPower ();
     if(hp <= 0){
         hp = 0;
         isDead = true;
         Death();
     }
 }
Ejemplo n.º 2
0
 protected void Damage(DamageSource damageSource)
 {
     if (isDead)
     {
         return;
     }
     print(damageSource.GetPower() + " damage to enemy");
     hp -= damageSource.GetPower();
     if (hp <= 0)
     {
         hp     = 0;
         isDead = true;
         Death();
     }
 }
Ejemplo n.º 3
0
 protected virtual void Damage(DamageSource source)
 {
     int power = source.GetPower ();
     print (power + " damage to Player!");
     controller.transform.rotation = Quaternion.LookRotation (source.GetDirection());
     animator.SetTrigger ("damage_trig");
     hp -= power;
     hp = Mathf.Max (0, hp);
 }
Ejemplo n.º 4
0
 public void Hit(DamageSource source)
 {
     int power = source.GetPower ();
     if (IsDamaging()){
         print(power + " damage to player, but nodamage");
         return;
     }
     Damage (source);
 }
Ejemplo n.º 5
0
    virtual protected void Damage(DamageSource source)
    {
        int power = source.GetPower();

        print(power + " damage to Player!");
        controller.transform.rotation = Quaternion.LookRotation(source.GetDirection());
        animator.SetTrigger("damage_trig");
        hp -= power;
        hp  = Mathf.Max(0, hp);
    }
Ejemplo n.º 6
0
    public void Hit(DamageSource source)
    {
        int power = source.GetPower();

        if (IsDamaging())
        {
            print(power + " damage to player, but nodamage");
            return;
        }
        Damage(source);
    }