示例#1
0
        public static bool GetTriggerButton(InputTriggerButton button)
        {
            if (_instance._inputDevice == InputDevice.KeyboardAndMouse)
            {
                return(false);
            }

            if (button == InputTriggerButton.Left)
            {
                return(_instance._currentTriggerValues.x >= 1.0f);
            }
            else if (button == InputTriggerButton.Right)
            {
                return(_instance._currentTriggerValues.y >= 1.0f);
            }
            else
            {
                return(_instance._currentTriggerValues.x >= 1.0f || _instance._currentTriggerValues.y >= 1.0f);
            }
        }
        public static bool GetTriggerButtonUp(InputTriggerButton button)
        {
            if (_instance._inputDevice == InputDevice.KeyboardAndMouse)
                return false;

            if (button == InputTriggerButton.Left) {
                return (_instance._currentTriggerValues.x < 1.0f && _instance._lastTriggerValues.x >= 1.0f);
            } else if (button == InputTriggerButton.Right) {
                return (_instance._currentTriggerValues.y < 1.0f && _instance._lastTriggerValues.y >= 1.0f);
            } else {
                return (_instance._currentTriggerValues.x < 1.0f && _instance._lastTriggerValues.x >= 1.0f) ||
                    (_instance._currentTriggerValues.y < 1.0f && _instance._lastTriggerValues.y >= 1.0f);
            }
        }