GPC_GetButtonUp() public static method

Returns true if the given Button was released this frame.
public static GPC_GetButtonUp ( Button, button ) : bool
button Button,
return bool
Beispiel #1
0
        /// <summary>
        /// Get state of button corresponding to gaze pointer
        /// </summary>
        /// <returns></returns>
        protected PointerEventData.FramePressState GetGazeButtonState()
        {
            var pressed  = Input.GetKeyDown(gazeClickKey) || OVRGamepadController.GPC_GetButtonDown(joyPadClickButton);
            var released = Input.GetKeyUp(gazeClickKey) || OVRGamepadController.GPC_GetButtonUp(joyPadClickButton);

#if UNITY_ANDROID && !UNITY_EDITOR
            pressed  |= Input.GetMouseButtonDown(0);
            released |= Input.GetMouseButtonUp(0);
#endif

            if (pressed && released)
            {
                return(PointerEventData.FramePressState.PressedAndReleased);
            }
            if (pressed)
            {
                return(PointerEventData.FramePressState.Pressed);
            }
            if (released)
            {
                return(PointerEventData.FramePressState.Released);
            }
            return(PointerEventData.FramePressState.NotChanged);
        }