TrafficOptions
Description
A properties class used to initialize the Traffic System
Declaration
Members
minDistanceToAdd
Beyond the MinDistanceToAdd, vehicles will spawn even without any obstructions or buildings blocking the view.
distanceToRemove
This value represents the approximate distance from the player at which a vehicle is flagged to be removed from the scene.
masterVolume
Represents the proximity from the player within which the adjacent cells will be active.
useWaypointPriority
Enables the usage of priority waypoints.
greenLightTime
The master intersection green time, if set, will override the individual times set on each intersection.
yellowLightTime
The master intersection yellow time, if set, will override the individual times set on each intersection.
activeSquaresLevel
Represents the proximity from the player within which the adjacent cells will be active.
initialDensity
The number of vehicles that will be active from the start. Should be <= than maxNrOfVehicles.
lightsOn
If true, the vehicles will be instantiated with lights on by default.
disableWaypointsArea
Mark the waypoints in that area as disabled from the start. No vehicles will spawn there.
For more in-depth details of each member consult the Initializing Assetsection.
Example
Assign all the properties inside the inspector, create a TrafficOptions object, and add it to the Initialize method.
If an option is not set, the default value will be used. Only set the properties you want to change.
Last updated