/// <summary> /// Checks to see if the inputted joystick has been moved down /// </summary> /// <param name="controller">Joystick to check</param> /// <returns>true or false</returns> public static bool JoystickDown(Joysticks controller) { if (Input.GetAxisRaw(controller.ToString() + "UD") > .15f) { return(true); } else { return(false); } }
/// <summary> /// Checks to see if the inputted joystick has been moved left /// </summary> /// <param name="controller">Joystick to check</param> /// <returns>true or false</returns> public static bool JoystickLeft(Joysticks controller) { if (Input.GetAxisRaw(controller.ToString() + "LR") < -.15f) { return(true); } else { return(false); } }
/// <summary> /// Checks to see if the button has been released on the desired player /// </summary> /// <param name="controller">controller to check</param> /// <param name="button">Button to check</param> /// <returns>true or false</returns> public static bool ButtonReleased(Joysticks controller, Buttons button) { if (Input.GetButtonUp(controller.ToString() + button.ToString())) { return(true); } else { return(false); } }
/// <summary> /// Checks to see if the button has been pressed on the desired player /// </summary> /// <param name="controller">controller to check</param> /// <param name="button">Button to check</param> /// <returns>true or false</returns> public static bool ButtonPress(Joysticks controller, Buttons button) { if (Input.GetButtonDown(controller.ToString() + button.ToString())) { return(true); } else { return(false); } }
/// <summary> /// Checks to see if the inputted joystick has been moved to the south west position /// </summary> /// <param name="controller">Joystick to check</param> /// <returns>true or false</returns> public static bool JoystickSouthWest(Joysticks controller) { if ((Input.GetAxisRaw(controller.ToString() + "UD") > .15f) && (Input.GetAxisRaw(controller.ToString() + "LR") < -.15f)) { return(true); } else { return(false); } }
public static string JoystickInputToAxis(Joysticks joystick, JoystickAxes axis) { return joystick.ToString() + axis; }
public static string JoystickInputToAxis(Joysticks joystick, JoystickAxes axis) { return(joystick.ToString() + axis); }