Skip to content

Instantly share code, notes, and snippets.

@sverrirs
Created November 12, 2015 00:10
Show Gist options
  • Save sverrirs/18adda19a23ba96e48f1 to your computer and use it in GitHub Desktop.
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)
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