Professional Documents
Culture Documents
Cross Platform in Put Guidelines
Cross Platform in Put Guidelines
2) The set of scripts provided are the scripts we used to put together the control
rigs prefabs. They provide a simplified way of reading basic mobile input, such as
tilt, taps and swipe gestures. They are designed so that various mobile controls
can be read in the same way as regular Unity axes and buttons. You can use these
scripts to build your own MobileControlRigs.
For example the Car control rig feeds the tilt input of the mobile device to the
"Horizontal" axis, and has an accelerator and brake touch button which are fed as a
pair into the "Vertical" axis. These are virtual equivalents of the real
"Horizontal" and "Vertical" axes defined in Unity's Input Manager.
To use the CrossPlatformInput, you need to drop a "Mobile Control Rig" into your
scene (or create your own), and then make calls to CrossPlatformInput functions,
referring to the axes and buttons that the Rig implements.
When reading input from the CrossPlatformInput class, the values returned will be
taken either from Unity's Input Manager settings, or from the mobile-specific
controls set up, depending on which build target you have selected.
The optional define (which is set by default, but can be disabled using the "Mobile
Input" menu), is "MOBILE_INPUT". This causes the MobileControlRigs to become active
when a mobile build target is selected. It also enables certain mobile-specific
control nuances in some of the packages, which make more sense when the character
or vehicle is being controlled using mobile input (such as auto-leveling the
character's look direction). This define is optional because some developers prefer
to use standalone input methods instead of the Unity Remote app, when testing
mobile apps in the editor's play mode.