UnityEngine.Input.GetKey C# (CSharp) Méthode

GetKey() public static méthode

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

Usage Example

Exemple #1
0
        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