public static void WhenInRange(this GameObject actor1, Vector3 position, float radius, VetoingAction action) { GameObject location = new GameObject(); location.name = "Location Marker"; location.transform.position = position; WhenInRange(actor1, location, radius, action); }
public static void WhenInRange(this GameObject actor1, GameObject actor2, float radius, VetoingAction action) { Aura aura = null; aura = actor2.AddAura(radius, (o) => { if (action()) { MonoBehaviour.Destroy(aura.gameObject); } }, null, actor1); aura.gameObject.name = "Trigger: " + actor1.name + " within " + radius + " units"; }