コード例 #1
0
 public override void OnTakeDamage(IEntityDamageEvent e)
 {
     base.OnTakeDamage(e);
     if (isDeath)
     {
         return;
     }
     // Add animation hit here
     animator?.SetTrigger("onHit");
 }
コード例 #2
0
    // Callback function when player take damage
    public virtual void OnTakeDamage(IEntityDamageEvent e)
    {
        if (isDeath)
        {
            return;
        }
        var damage = e.GetDamage(ref isCrit);

        entityStat.TakeDamage(damage, OnDied);
        // Create pop up damage here
        PopupDamage.Create(transform.position, (int)damage, isCrit);
    }
コード例 #3
0
    public override void OnTakeDamage(IEntityDamageEvent e)
    {
        if (isIntangible)
        {
            return;
        }
        var damage = e.GetDamage(ref isCrit);

        entityStat.TakeDamage(damage, OnDied);
        // Create pop up damage here
        PopupDamage.Create(transform.position, (int)damage, isCrit);
        // Add animation hit here
        animator.SetTrigger("onHit");
    }