示例#1
0
        public float ReadAxis(TAction axialInput)
        {
            var inputs = mMapping.ExpandDirectionalInputs(axialInput);

            // SingleInputPerAxis is not support for keyboard input. There must be 2 inputs
            // mapped per axis but we don't enforce this, just don't f**k it up. The first
            // element must be in the negative direction
            if (UnityEngine.Input.GetKey(inputs[0]))
            {
                return(-1f);
            }
            else if (UnityEngine.Input.GetKey(inputs[1]))
            {
                return(1f);
            }

            return(0f);
        }