Exemplo n.º 1
0
    private void OnTriggerEnter(Collider collision)
    {
        Interactable interactable = RecursiveFinder.FromParent <Interactable>(collision.gameObject);

        if (interactable)
        {
            // We found something we can interact with
            Interactables.Add(interactable);
        }
    }
Exemplo n.º 2
0
    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;
            }
        }
    }