Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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;
 }
Пример #4
0
 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;
 }