Skip to main content

IAttack.CalculateHit

Declaration#

public abstract virtual void CalculateHit(IDamageable target, IDamageSource source, Action<HitResult> callback)

Parameters#

NameDescription
targetObject being attacked
sourceObject making the attack
callbackCallback to raise with result

Description#

Check if the attack (as a whole) hits

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class Example : MonoBehaviour{    public void ExampleMethod(IAttack target, IDamageSource attacker, IDamageable other)    {        target.CalculateHit(other, attacker, CalculateHitResult);    }
    private void CalculateHitResult(HitResult result)    {        Debug.Log(result);    }}