Пример #1
0
    public bool GetButtonUp(string _buttonName)
    {
        InputDevice inputDevice = GetDevice();

        if (inputDevice != null)
        {
            return(inputDevice.GetControlByName(_buttonName).WasReleased);
        }
        else
        {
            return(false);
        }
    }
Пример #2
0
    void Start()
    {
        InputDevice inputDevice = InputManager.ActiveDevice;

        for (int i = 0; i < inputDevice.Controls.Length; i++)
        {
            if (inputDevice.Controls[i] != null)
            {
                Debug.Log(inputDevice.Controls[i].ToString());
                Debug.Log(inputDevice.GetControlByName(inputDevice.Controls[i].Handle.ToString()));
            }
        }
    }
Пример #3
0
    public float GetAxis(string _axis)
    {
        InputDevice inputDevice = GetDevice();

        if (inputDevice != null)
        {
//			Debug.Log(_axis+": "+inputDevice.GetControlByName(_axis).Value);
            return(inputDevice.GetControlByName(_axis).Value);
        }
        else
        {
            return(0);
        }
    }