private void OnEnable()
 {
     if (handler != null)
     {
         handler.Subscribe(this);
     }
 }
Пример #2
0
    public void DoPointerEnter(GameObject go)
    {
        VRDControllerInputHandler handler = go.GetComponent <VRDControllerInputHandler>() ?? go.GetComponentInParent <VRDControllerInputHandler>();

        if (handler != null)
        {
            handler.Subscribe(this);
        }

        UI_Button.OnPointerEnter(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);
        }
    }