Exemplo n.º 1
0
    private void HitObject(GameObject hitObject)
    {
        HealthController2D hitObjectHealthController = hitObject.GetComponent <HealthController2D>();

        if (hitObjectHealthController != null)
        {
            hitObjectHealthController.TakeDamage(currentAttack.attackDamage);
        }
    }
Exemplo n.º 2
0
    public override void ZoneEffect(GameObject effectedObject)
    {
        HealthController2D healthController = effectedObject.GetComponent <HealthController2D>();

        if (healthController != null)
        {
            healthController.TakeDamage(zoneDamage);
        }
    }
Exemplo n.º 3
0
    public virtual void HitObject(GameObject hitObject)
    {
        Controller2D       hitObjectController       = hitObject.GetComponent <Controller2D>();
        HealthController2D hitObjectHealthController = hitObject.GetComponent <HealthController2D>();

        if (hitObjectController != null)
        {
            if (attackKnockbackDirection != Vector2.zero)
            {
                hitObjectController.SetNewStaticVelocity(attackKnockbackDirection, attackKnockbackTime);
            }
        }

        if (hitObjectHealthController != null)
        {
            hitObjectHealthController.TakeDamage(attackDamage);
        }
    }