IAttack.CalculateHit
Declaration#
public abstract virtual void CalculateHit(IDamageable target, IDamageSource source, Action<HitResult> callback)Parameters#
| Name | Description |
|---|---|
| target | Object being attacked |
| source | Object making the attack |
| callback | Callback 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); }}