Ejemplo n.º 1
0
    private float GetAxis(AxisSet.AxisCascade axisCascade)
    {
        float value = 0;

        try
        {
            value += UnityEngine.Input.GetAxis(axisCascade.pcName);
        }
        catch (System.Exception)
        {
            try
            {
                value += UnityEngine.Input.GetButton(axisCascade.pcName) ? 1 : 0;
            }
            catch (System.Exception)
            {
            }
        }

        value += XboxInput.GetAxis(_inputId, axisCascade.xboxAxis);
        value += UIInput.GetAxis(axisCascade.uIAxis);

        return(Mathf.Clamp(value, -1, 1));
    }