public void DoPointerEnter(GameObject go) { VRDControllerInputHandler handler = go.GetComponent <VRDControllerInputHandler>() ?? go.GetComponentInParent <VRDControllerInputHandler>(); if (handler != null) { handler.Subscribe(this); } UI_Button.OnPointerEnter(null); }
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 OnTriggerEnter(Collider other) { // Attempt to find an input handler // on the colliding object VRDControllerInputHandler controller = other.GetComponent <VRDControllerInputHandler>(); // If an input handler is found // subscribe to it so input can // be reacted to if (controller != null) { handler = controller; handler.Subscribe(this); } }
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; } } }