void IPointerUpHandler.OnPointerUp(PointerEventData eventData) { IVRHandlerEventData pointerData = eventData as IVRHandlerEventData; if (null != pointerData) { transform.parent = null; } }
void IPointerDownHandler.OnPointerDown(PointerEventData eventData) { IVRHandlerInputModule input = EventSystem.current.currentInputModule as IVRHandlerInputModule; IVRHandlerEventData pointerData = eventData as IVRHandlerEventData; if (null != input && null != pointerData) { IVRManager.Instance.Show("Hold the button to move cube"); transform.parent = input.handlerPointer.transform; } }