Skip to main content

BasicAttack.CalculateHit

Declaration#

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

Parameters#

NameDescription
targetTarget being attacked
sourceObject performing attack
callbackCallback to invoke

Description#

Check if the attack hits

Usage#

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