| 1 | {{{ #!Markdown |
| 2 | |
| 3 | # CarInput |
| 4 | |
| 5 | Main script for controlling the scene. The controllable vehicles and the logic of the scene are managed here. |
| 6 | |
| 7 | - Reads, manages and applies all user input (keyboard, joystick, etc). |
| 8 | - Allows vehicle selection and driving. |
| 9 | - Controls the camera modes. |
| 10 | - Configures the camera and shadows for quality modes (F12). |
| 11 | - Shows the vehicle's dashboard (speed, driving aids, etc). |
| 12 | - Shows the help window (H). |
| 13 | - Shows the vehicle's telemetry window (B) if a [CarTelemetry](wiki:CarTelemetry) script is available in the same GameObject. |
| 14 | - Offers the slow time feature. |
| 15 | |
| 16 | This script is added to a _Main_ GameObject intended to hold the control scripts for the scene. |
| 17 | |
| 18 | __Cars__: references to the controllable vehicles in the scene. They must contain a [CarControl](wiki:CarControl) script. User can switch the active car with the PageUp / PageDown keys. |
| 19 | |
| 20 | __startupCar__: car of the list that will be selected on startup. |
| 21 | |
| 22 | __MainCamera__: reference to the main camera of the scene. It must contain a [CameraControl](wiki:CameraControl) script. |
| 23 | |
| 24 | __MainLight__: reference to the main light of the scene. The script configures its shadows for offering the low quality mode (F12). |
| 25 | |
| 26 | __PayLoad__: reference to the object used as payload (the gray box in the [live demo][], key E for moving. It's just for fun in the demo). |
| 27 | |
| 28 | __slowTime__: time scale used for the slow time mode (T). |
| 29 | |
| 30 | __showHelp__: help window enabled or disabled (H). |
| 31 | |
| 32 | __guiEnabled__: vehicle's dashboard enabled or disabled. |
| 33 | |
| 34 | __BigTextStyle, TextStyle, BoxStyle, guiSkin__: GUIStyle and GUISkin objects for displaying the dashboard. |
| 35 | |
| 36 | |
| 37 | |
| 38 | [live demo]: http://www.edy.es/unity/offroader.html |
| 39 | }}} |