ControlScript

This is the global control script, meant for storing static variables and settings and managing initializations. There must only be one instance of this script in a scene at a time.

Variables
No Menu - Disables the demo menu. When this is set to false, the target variable of CameraScript must be set to the vehicle you want to drive.

No Hud - Disables the demo HUD.

delta - Static delta time multiplier for events in Update.

frameDelta - Delta without the multiplier for Time.timeScale.

fixedDelta - Static multiplier for events in FixedUpdate.

Vehicles - These are the vehicles featured in the demo and can be removed from the script.

Spawn Point Set - The spawn point for vehicles.

Spawn Rotation - The lateral spawn rotation for vehicles. This represents the forward direction of a spawned vehicle. In terms of quaternions, the up direction is Vector3.up.

Main Cam - The main camera of the scene.

Title - The title text object of the demo, this can be removed. Can be null.

Use Metric Units - Should the game use metric units instead of imperial units?

Set Boost Power - Should the boost power, burn rate, and fill rate of a vehicle automatically be adjusted depending on the boost type of the vehicle when it's spawned? This will override the boost settings on vehicles.

Hud - The HUD object, this can be removed if you do not want to use the GUI elements from this package.

Hud Boost Materials - The boost flame materials for the different boost types. When a vehicle is spawned, it automatically selects the material for its boost flames from this list based on its boost type.

Fall Limit - How far the vehicle is allowed to fall off the map before it is respawned. This can be removed.

Tire Mark Object - The prefab for tire marks.

Tire Mark Length Set - The maximum length allowed for tire marks. Each two vertices added to a tire mark is considered a segment. Default is 100.

Tire Mark Quality Set - The frequency at which new segments are added to tire marks. For example, a value of 10 would mean that 10 steps will pass before a new segment is added. Default is 10.

Tire Mark Time Set - The number of steps a tire mark will remain after it has finished being created. Once this time is up, the tire mark will fade away and destroy itself. Default is 10000.

Hidden Variables
These are variables which are not visible in the inspector, yet useful for writing scripts.

metricUnits - Should the game use metric units? If not, the game will use imperial units. This is a static variable and is automatically set by the useMetricUnits variable.

Input Axes
This script contains static strings which reference the name of different axes in the Unity Input Manager. VehicleParent accesses these from this script.

Accel Axis - The input axis for accelerating and braking. Positive is accel, negative is brake. The 3rd axis represents both the left and right triggers on X-Input controllers (Xbox 360 controllers). Negative for left trigger, positive for right trigger.

Gas Axis - The input axis for acceleration only. The 10th axis represents the right trigger exclusively.

Brake Axis - The input axis for brake only. The 9th axis represents the left trigger exclusively. This axis is positive.

Steer Axis - The input axis for steering vehicles and rotating them on their local y-axis while in the air.

Flip Axis - The input axis for rotating vehicles around their local x-axis while in the air.

Roll Axis - The input axis for rotating vehicles around their local z-axis while in the air.

Boost Button - The button for boosting.

Ebrake Button - The button for the emergency brake.

Up Shift Button - The button for upshifting.

Down Shift Button - The button for downshifting.

Cam Axis X - The x-axis for camera input.

Cam Axis Y - The y-axis for camera input.

Change Cam Mode Button - The button for changing the camera mode.

Change Cam Pos Button - The button for changing the camera position.

Look Back Button - The button for looking back.

Reset Button - The button for resetting vehicle rotation.

Repawn Button - The button for respawning a vehicle.

Restart Button - The button for restarting the game.