private void OnTriggerEnter(Collider collision) { Interactable interactable = RecursiveFinder.FromParent <Interactable>(collision.gameObject); if (interactable) { // We found something we can interact with Interactables.Add(interactable); } }
private void OnTriggerExit(Collider collision) { Interactable interactable = RecursiveFinder.FromParent <Interactable>(collision.gameObject); if (interactable) { // We found something we can interact with Interactables.Remove(interactable); if (interactable == Target) { Untarget(); Target = null; } } }