public static bool FibButtonUp(FibJoystick axis) { if (axis == FibJoystick.ButLeft) { return(Input.GetKeyUp("joystick button 0")); } else if (axis == FibJoystick.ButRight) { return(Input.GetKeyUp("joystick button 3")); } else if (axis == FibJoystick.ButUp) { return(Input.GetKeyUp("joystick button 2")); } else if (axis == FibJoystick.ButDown) { return(Input.GetKeyUp("joystick button 3")); } else if (axis == FibJoystick.ButPower) { return(Input.GetKeyUp("joystick button 10")); } else { return(false); } }
public static float FibAxis(FibJoystick axis) { if (axis == FibJoystick.Vertical) { return(-Input.GetAxis("Axis1")); } else if (axis == FibJoystick.Horizontal) { return(-Input.GetAxis("Axis2")); } else if (axis == FibJoystick.ButLeft) { return(Input.GetKey("joystick button 0")?1f:0f); } else if (axis == FibJoystick.ButRight) { return(Input.GetKey("joystick button 3")?1f:0f); } else if (axis == FibJoystick.ButUp) { return(Input.GetKey("joystick button 2")?1f:0f); } else if (axis == FibJoystick.ButDown) { return(Input.GetKey("joystick button 3")?1f:0f); } else if (axis == FibJoystick.ButPower) { return(Input.GetKey("joystick button 10")?1f:0f); } else { return(0f); } }
public static bool FibButtonDown(FibJoystick axis) { if( axis==FibJoystick.ButLeft ) return Input.GetKeyDown("joystick button 0"); else if( axis==FibJoystick.ButRight ) return Input.GetKeyDown("joystick button 3"); else if( axis==FibJoystick.ButUp ) return Input.GetKeyDown("joystick button 2"); else if( axis==FibJoystick.ButDown ) return Input.GetKeyDown("joystick button 3"); else if( axis==FibJoystick.ButPower ) return Input.GetKeyDown("joystick button 10"); else return false; }
public static float FibAxis(FibJoystick axis) { if( axis==FibJoystick.Vertical ) return -Input.GetAxis("Axis1"); else if( axis==FibJoystick.Horizontal ) return -Input.GetAxis ("Axis2"); else if( axis==FibJoystick.ButLeft ) return Input.GetKey("joystick button 0")?1f:0f; else if( axis==FibJoystick.ButRight ) return Input.GetKey("joystick button 3")?1f:0f; else if( axis==FibJoystick.ButUp ) return Input.GetKey("joystick button 2")?1f:0f; else if( axis==FibJoystick.ButDown ) return Input.GetKey("joystick button 3")?1f:0f; else if( axis==FibJoystick.ButPower ) return Input.GetKey("joystick button 10")?1f:0f; else return 0f; }