Created
November 12, 2015 00:10
-
-
Save sverrirs/18adda19a23ba96e48f1 to your computer and use it in GitHub Desktop.
Necessary changes i had to make to the default PlayerController class in the SpaceShooter demo project for Unity3d so that my Xbox 360 Big Button Controller could work (https://gist.github.com/sverrirs/0a0181fb17b29d070003)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Update() | |
{ | |
bool isFiring = Input.GetButton("Fire1") || XboxBigButtonJoystick.GetButton(Controller.Red, Buttons.A); | |
if (isFiring && Time.time > nextFire) | |
{ | |
... | |
} | |
} | |
public void FixedUpdate() | |
{ | |
// Retrieve inputs | |
float moveHorizontal = Input.GetAxis("Horizontal") + XboxBigButtonJoystick.GetAxis(Controller.Red, "Horizontal"); | |
float moveVertical = Input.GetAxis("Vertical") + XboxBigButtonJoystick.GetAxis(Controller.Red, "Vertical"); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment