Traffic Light
How To Customize City Crossroads
Open Global Light Settings.
Spirit604/CityEditor/Window/Global Traffic Light Settings
Enable Show world info.
You can now quickly view and adjust the timelines of all the crossroads.
Enable Show disabled Lights to see crossroads with traffic lights switched off.
Select the desired crossroad and press Select.
In the TrafficLightCrossroad component, you can now set the timings.
How To Assign Light
Open Global Light Settings.
Enable Show light connections.
Select Light connection type for example Traffic node.
Select H0 or H1 depending on the desired light index.
Next, select the desired T (TrafficNode).
Now, the selected TrafficNode will have the selected TrafficLightHandler.
In the same way, you can assign PedestrianNodes and Light objects by changing the Light connection type.
Pedestrian node connection example.
Light object connection example.
Global Lights Settings
Window for quick display of crossroad timings and for linking the traffic lights to different entities.
How To Use
Read more here.
Settings
Common Settings
Scene light info example.
Scene light info (include disabled) example.
Connection Settings
- Light connection type :
All : show all connection types.
Traffic node : show traffic node connection only.
Pedestrian node : show pedestrian node connection only.
Light : show light object connection only.
Selected Light connection type : [TrafficNode] and Lights index : [0] example.
World Lights
- Timeline: shows light states of crossroad and total duration.
TrafficLight [0] : TrafficLightHandler with light index 0.
TrafficLight [1] : TrafficLightHandler with light index 1.
SceneView Light Objects Description
- Select:
H0/H1 : TrafficLightHandler (index 0, index 1).
T0/T1/T : TrafficNode (index 0, index 1, no index).
P0/P1/P : PedestrianNode (index 0, index 1, no index).
L0/L1/L : Light object (index 0, index 1, no index).
- Unselect:
H- : unselect TrafficLightHandler.
T- : unselect TrafficNode.
P- : unselect PedestrianNode.
L- : unselect Light object.
All connection types and -1 light index are enabled example.
How To Replace Global Light States
Open Global Light Settings window.
Click the * button to expand the Replace settings.
Select the source state container you wish to replace.
Select your new desired State container.
Click the Replace button.
As a result, all the source State containers are replaced.
Light States
Green : car only drives on a green lights.
Red
Yellow
Red Yellow : red and yellow lights at the same time, shown as orange in the inspector.
Light Index
Unique traffic light ID in TrafficLightCrossroad defined in TrafficLightHandler used to link TrafficLightHandlers and traffic lights by index.
Traffic Light Handler
Traffic Light Handler is an entity for handling the state of a traffic light. Is part of TrafficLightCrossroad.
Settings
Components
Traffic Light Object
Main Component
Traffic light object in the scene.
Contains data on the light frames and linked light indexes.
Traffic light object example.
Light Frame
Contains data on traffic light indicators.