InputMaster Xbox 360 Controls

From Unify Community Wiki
Revision as of 20:17, 6 November 2014 by Michael Notarnicola (Talk | contribs)

Jump to: navigation, search


InputMaster Xbox 360 Controls

Relevant for version v7.1.1b

Initial Notes

  • If you haven't read the primer tutorial, go read that now before reading this.
  • Xbox 360 support is currently only for the Windows editor and for Windows builds.
  • This tutorial is NOT a Unity tutorial nor a primer to C# or programming in general. This tutorial assumes that you already have a good grasp of how Unity works and that you have intimate knowledge of programming concepts and the C# language.
  • BSGTools is C# ONLY. Unityscript and Boo are NOT supported.
  • InputMaster was designed for programmers, by a programmer. It has no configurable options in the Inspector, and should not be manually added to a GameObject for any reason. All configuration is done in code. However, if you'd like to make some variables editable in the Inspector, you can expose them through your InputManager.
  • It is worth mentioning that this tutorial uses a Singleton pattern to provide access to the InputManager script we will be creating. This pattern is easy and fast to implement, which is why I'm using it here. Some people argue that the Singleton pattern is bad design. Regardless, this is a beginner's tutorial, and I'll be treating it as such.

Setting Up The Scene

We're going to base this scene off of the scene from the primer tutorial.

Delete your InputManager script, as we're going to remake it in this tutorial.

You can either delete or leave your PlayerController script, we'll be making major adjustments to it.

Make sure that the editor is targeting Standalone Windows for builds.

Control Overview

There are 3 types of XboxControls:

  • XButtonControl
    • Has two bindings
      • Positive - REQUIRED
      • Negative - Optional
    • The bindings are of type XButton:
      • A/B/X/Y Face Buttons
      • Up/Down/Left/Right DPad
      • The shoulder buttons
      • The Back, Start and Guide buttons
      • The Stick buttons (pressing in the analog sticks)
    • Conceptually identical to the KeyControl
  • XStickControl
    • Has one binding
      • Positive - REQUIRED
    • The binding is of type XStick:
      • Left Stick X Axis
      • Left Stick Y Axis
      • Right Stick X Axis
      • Right Stick Y Axis
  • XTriggerControl
    • Has one binding
      • Positive - REQUIRED
    • The binding is of type XTrigger
      • Left Trigger
      • Right Trigger
    • Functions as you expect. Does not have Unity's flaw of the Triggers being interpreted as one axis.
Personal tools