public virtual void Show(RaycastHit hit) { transform.position = hit.point; transform.LookAt(hit.point + hit.normal); this.gameObject.SetActive(true); if (hit.collider && hit.collider.gameObject) { GameObject target = hit.collider.gameObject; PointerEventData e = new CursorPointerEventData(this, EventSystem.current); if (!_target) { OnPointerEnter(target, e); } else if (_target != target) { OnPointerExit(_target, e); OnPointerEnter(target, e); } _target = target; } }
private void HandleButtonEvents(OVRInput.Button button, PointerEventData.InputButton mouseButton, ref bool isButtonDown) { if (button != OVRInput.Button.None && Controller != OVRInput.Controller.None) { PointerEventData e = new CursorPointerEventData(this, EventSystem.current); e.button = mouseButton; if (OVRInput.GetDown(button, this.Controller)) { OnPointerDown(_target, e); isButtonDown = true; } if (OVRInput.GetUp(button, this.Controller)) { OnPointerUp(_target, e); if (isButtonDown) { OnPointerClick(_target, e); } isButtonDown = false; } } }