Esempio n. 1
0
    ///<summary>Returns Input.GetKey based on the name of a keybinding rather than the name of the key itself</summary>
    public bool GetKey(string key)
    {
        if (Application.isMobilePlatform && key == "press")
        {
            if (Input.touchCount != 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }

        return(Input.GetKey((KeyCode)controls.GetType().GetField(key).GetValue(controls)));
    }