Esempio n. 1
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);
    }
    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");
    }