// If this component is disabled
 // or the owning GameObject is
 // set to be inactive unsubscribe
 // to input.
 private void OnDisable()
 {
     if (handler != null)
     {
         handler.Unsubscribe(this);
     }
 }
Ejemplo n.º 2
0
    public void DoPointerExit(GameObject go)
    {
        VRDControllerInputHandler handler = go.GetComponent <VRDControllerInputHandler>() ?? go.GetComponentInParent <VRDControllerInputHandler>();

        if (handler == null)
        {
            return;
        }

        handler.Unsubscribe(this);
        UI_Button.OnPointerExit(null);
    }
    public virtual void OnTriggerExit(Collider other)
    {
        // Attempt to find an input handler on
        // the exiting object
        VRDControllerInputHandler controller =
            other.GetComponent <VRDControllerInputHandler>();

        // If a handler was found,
        // unsubscribe from to stop
        // receiving input
        if (controller != null)
        {
            controller.Unsubscribe(this);
            if (controller == handler)
            {
                handler = null;
            }
        }
    }