コード例 #1
0
 void GetInput(int joyNum)
 {
     //FaceButtons
     CurrentInputState.Set_A(Input.GetButton("joy" + joyNum + "aButton"));
     CurrentInputState.Set_B(Input.GetButton("joy" + joyNum + "bButton"));
     CurrentInputState.Set_X(Input.GetButton("joy" + joyNum + "xButton"));
     CurrentInputState.Set_Y(Input.GetButton("joy" + joyNum + "yButton"));
     //facebuttons down
     CurrentInputState.Set_Adn(Input.GetButtonDown("joy" + joyNum + "aButton"));
     CurrentInputState.Set_Bdn(Input.GetButtonDown("joy" + joyNum + "bButton"));
     CurrentInputState.Set_Xdn(Input.GetButtonDown("joy" + joyNum + "xButton"));
     CurrentInputState.Set_Ydn(Input.GetButtonDown("joy" + joyNum + "yButton"));
     //D-Pad Input
     CurrentInputState.Set_D_PadVertical(Input.GetAxis("joy" + joyNum + "dVertical"));
     CurrentInputState.Set_D_PadHorizontal(Input.GetAxis("joy" + joyNum + "dHorizontal"));
     //Shoulder Buttons
     CurrentInputState.Set_LeftBumper(Input.GetButton("joy" + joyNum + "LeftBumper"));
     CurrentInputState.Set_RightBumper(Input.GetButton("joy" + joyNum + "RightBumper"));
     CurrentInputState.Set_LeftTrigger(Input.GetAxis("joy" + joyNum + "LeftTrigger"));
     CurrentInputState.Set_RightTrigger(Input.GetAxis("joy" + joyNum + "RightTrigger"));
     //Shoulder Buttons Down
     CurrentInputState.Set_LeftBumperDn(Input.GetButtonDown("joy" + joyNum + "LeftBumper"));
     CurrentInputState.Set_RightBumperDn(Input.GetButtonDown("joy" + joyNum + "RightBumper"));
     //Joystick
     CurrentInputState.Set_LeftJoystickHorizontal(Input.GetAxis("joy" + joyNum + "LeftHorizontal"));
     CurrentInputState.Set_LeftJoystickVertical(Input.GetAxis("joy" + joyNum + "LeftVertical"));
     CurrentInputState.Set_RightJoystickHorizontal(Input.GetAxis("joy" + joyNum + "RightHorizontal"));
     CurrentInputState.Set_RightJoystickVertical(Input.GetAxis("joy" + joyNum + "RightVertical"));
     // CurrentInputState.Set_LeftJoystickClick(Input.GetButton("joy" + joyNum + "LeftClick"));
     // CurrentInputState.Set_RightJoystickClick(Input.GetButton("joy" + joyNum + "RightClick"));
     //Start and back
     CurrentInputState.Set_Start(Input.GetButtonDown("joy" + joyNum + "Start"));
     CurrentInputState.Set_Back(Input.GetButtonDown("joy" + joyNum + "Back"));
     TestingText.text = GetDebugText();
     CachedInputState = CurrentInputState.GetState();
 }