Complete API

All API methods are located inside Gley.TrafficSystem.API

API NameDescription

Add an external driving action to a traffic vehicle to customize its behavior.

Instantiates an excluded vehicle, the vehicle will work normally, but when it is removed it will not be instantiated again.

Adds a previously excluded vehicle back to the Traffic System and the vehicle behaves normally.

Adds a traffic vehicle to the nearest waypoint from the provided position.

Instantiates a vehicle at the nearest waypoint to the provided position and sets the vehicle's path to the closest waypoint to the provided destination.

Add from code an event on a specific waypoint.

Forces a traffic vehicle to change the lane in the indicated direction.

All traffic vehicles in the scene will decelerate and change lanes towards the edge of the road to create space for special vehicles such as police or ambulances.

Removes all the vehicles from a given area.

Disables all the waypoints from a given circular area defined by its center and radius.

The possible state in which a traffic vehicle can be.

Enable all disabled area waypoints.

An excluded vehicle will never be instantiated again by the Traffic System after it is removed from the scene.

Converts the excluded vehicle GameObject into its corresponding vehicle index.

Returns a list of all excluded vehicles.

Returns a waypoint path between a start position and an end position for a specific vehicle type.

Get the state stop state of a priority crossing.

Get the color of the traffic light for vehicles.

Gets the Vehicle Component from the vehicle with the index passed as a parameter.

Gets the index of a vehicle GameObject.

Get a list of all vehicles used by the Traffic System.

Get the current speed in km/h of the vehicle.

Get the current DriveActions of the specified vehicle.

Returns the Waypoint object for a given waypoint index.

Initializes the entire Traffic System by adding all the necessary components before starting the Traffic System.

Check if the Traffic System is initialized.

Remove a specific DriveActions action from a vehicle.

Remove a specific vehicle from the scene bypassing the remove conditions of the Traffic System.

Remove a predefined path for a vehicle.

Removes an event trigger attached to a waypoint.

Set how far away from the player the active intersections should be -> default is 1.

Update the active camera that is used to remove vehicles when are not in view.

Update active cameras that are used to remove vehicles when are not in view. This is used in multiplayer/split-screen setups.

Calculates a path from the current position of the vehicle to a specified destination.

Control the traffic vehicles' engine volume from the master volume.

Enable/disable hazard lights for a vehicle.

Force a road from a traffic light intersection to change to green.

Inform the priority pedestrian crossing that pedestrians started/stopped to cross.

Modify the number of active vehicles around the player.

Assign a predefined path to any active vehicle within the Traffic System.

When this method is called, the vehicle passed as a parameter is no longer controlled by the Traffic System until it is out of view and respawned.

A properties class used to initialize the Traffic System.

If a vehicle detects a collider and that collider is destroyed by another script, the OnTriggerExit method is not automatically triggered. In such cases, this method needs to be manually invoked to remove the obstacle in front of the traffic vehicle.

Turn all vehicle lights on or off.

Last updated