UnityEngine.Input.GetKey C# (CSharp) Method

GetKey() public static method

public static GetKey ( KeyCode key ) : bool
key KeyCode
return bool
		public static bool GetKey(KeyCode key) { return false; }
		public static bool GetKeyDown(KeyCode key) { return false; }

Usage Example

コード例 #1
0
ファイル: JoystickInput.cs プロジェクト: yabos/SaveTheQueen
        private void UpdateButtonInput()
        {
            float value;

            for (int i = 0; i < buttonAxisInputList.Count; ++i)
            {
                ButtonAxisInput buttonAxisInput = buttonAxisInputList[i];
                value = Input.GetAxis(buttonAxisInput.axisName);
                if (value != 0.0f)
                {
                    if (value == -1.0f)
                    {
                        buttonInputFlags |= buttonAxisInput.negativeButton;
                    }
                    else if (value == 1.0f)
                    {
                        buttonInputFlags |= buttonAxisInput.positiveButton;
                    }
                }
            }

            for (int i = 0; i < buttonInputList.Count; ++i)
            {
                ButtonInput buttonInput = buttonInputList[i];
                if (UInput.GetKey(buttonInput.keyCode))
                {
                    buttonInputFlags |= buttonInput.button;
                }
            }
        }
All Usage Examples Of UnityEngine.Input::GetKey