/// <summary> /// Get Ds4 axis readings /// </summary> /// <param name="axis">DS4 axis <see cref="DS4Axis"/></param> /// <returns>Axis reading from -1f to 1f</returns> public static float GetDS4Axis(DS4Axis axis) { switch (axis) { case DS4Axis.LeftStickX: return(UnityEngine.Input.GetAxis("DS4 X-Axis")); case DS4Axis.LeftStickY: return(UnityEngine.Input.GetAxis("DS4 Y-Axis")); case DS4Axis.RightStickX: return(UnityEngine.Input.GetAxis("DS4 3rd Axis")); case DS4Axis.RightStickY: //return Input.GetAxis("DS4 4th Axis"); return(UnityEngine.Input.GetAxis("DS4 6th Axis")); case DS4Axis.L2: return(UnityEngine.Input.GetAxis("DS4 4th Axis")); //return Input.GetAxis("DS4 5th Axis"); case DS4Axis.R2: return(UnityEngine.Input.GetAxis("DS4 5th Axis")); //return Input.GetAxis("DS4 6th Axis"); case DS4Axis.DPadX: return(UnityEngine.Input.GetAxis("DS4 7th Axis")); case DS4Axis.DPadY: return(UnityEngine.Input.GetAxis("DS4 8th Axis")); } return(0f); }
/// <summary> /// Raised whenever the specified <code>Axis</code> falls below the defined threshold /// </summary> /// <param name="Axis"></param> private void OnAxisUnder(DS4Axis Axis) { }
/// <summary> /// Raised whenever the specified <code>Axis</code> reaches the defined threshold /// </summary> /// <param name="Axis"></param> private void OnAxisOver(DS4Axis Axis) { }
public void SetThreshold(DS4Axis Axis, float Threshold) { axisThresholds[(int)Axis] = Threshold; }
public float GetThreshold(DS4Axis Axis) { return axisThresholds[(int)Axis]; }