Пример #1
0
    //public virtual bool IsAttacking()
    //{
    //    //value of 1 is end of anim
    //    //value of 0.5 is end of anim
    //    AnimatorStateInfo animStateInfo = _animator.GetCurrentAnimatorStateInfo(Consts.ANIMATION_ATTACK_LAYER);
    //    if (animStateInfo.IsName("Attack"))
    //    {
    //        return (animStateInfo.normalizedTime < 1.0f || animStateInfo.loop) && _attackFrame;
    //    }
    //    //Added AttackLoopBuffer in Animator to allow return false during loop
    //    return false;
    //}

    public override bool GiveDamage(float damage, BaseWorldCharacter attackedCharacter)
    {
        if (attackedCharacter != null)
        {
            if (attackedCharacter.TakeDamage(damage))
            {
                return(true);
            }
        }
        return(false);
    }
Пример #2
0
 public bool GiveDamage(float damage, BaseWorldCharacter attackedCharacter)
 {
     if (attackedCharacter != null)
     {
         if (attackedCharacter.TakeDamage(damage))
         {
             IncreaseCombatPoints();
             return(true);
         }
     }
     return(true);
 }