Road Segment

Road Segment is the main component of the road that contains traffic nodes, paths.

Youtube tutorial.

How To Create

Select from the Unity toolbar:

_images/RoadSegmentCreation.png

How To Customize

By default, RoadSegment contains RoadSegmentCreator component that can be used to customize a segment.

Main Components

Road Segment

Component for connection to other road segments.

_images/RoadSegment.png

Variables

Road segment placer : reference to the RoadSegmentPlacer.
Short title name : short name for RoadSegmentPlacer.
Show intersected paths : on/off intersection points in the scene.

Buttons

Connect nodes : auto-connect Traffic Nodes.
Reset nodes : reset already auto-connected paths of Traffic Nodes (except locked nodes).
Bake data : bake all paths data (path’s length, intersections).

TrafficLightCrossroad

Component for handling traffic lights at crossroad. For a quick look at timelines of city crossroads and traffic light connections, see here.

Cached

_images/TrafficLightCrossroadCached.png
Shared state container : shared light state container, that contain common traffic light timings that are shared with other light crossroads.
Traffic nodes : all Traffic Nodes of RoadSegment.
Traffic light handler data : light index and light handlers that are linked to the TrafficLightCrossroad.

Timeline common

Timeline common uses the timeline from the Shared state container.

_images/TrafficLightCrossroadLightTimeline.png

Note

You can easily replace the shared state container for all crossroads using the Global Light Settings tool.

Timeline custom

Custom timeline is designed for custom timings of the traffic light segment

_images/TrafficLightCrossroadCustomTimelineExample1.png
How to add states:
  1. Enable custom settings.

  2. Select the desired TrafficLightHandler.

  3. Press the + button.

  4. Add desired states.

  5. Enter the duration of the state.

_images/TrafficLightCrossroadCustomTimeline.png

Once you have set up 1 TrafficLightHandler, you can loop to the 2nd TrafficLightHandler.

How to loop timeline:
  1. Select the TrafficLightHandler to be looped.

  2. Enter the Source Data Handler Index parameter based on which to loop.

    _images/TrafficLightCrossroadCustomTimelineLoopExample1.png

    Settings example.

  3. Click the Loop Time button.

Loop result:

_images/TrafficLightCrossroadCustomTimelineLoopExample2.png

Custom arrow lights

Arrows are used for the custom traffic light for the selected path.

How to create arrows:
  1. Click Show Custom Arrow Light Setup.

  2. Select Custom Related Light Index.

  3. Select related TrafficNode from the toolbar.

    _images/TrafficLightCrossroadLightArrowSettingsExample.png
  4. Select related path from the toolbar.

    _images/TrafficLightCrossroadLightArrowSettingsExample2.png

    Selected path example.

  5. Click the Add Custom Light button.

Note

To remove the light arrow, select the appropriate TrafficNode and Path and press the Remove Selected Path button.

Baking info

The intersection of paths is only baked in those paths that are in the segment. How to bake.

_images/RoadSegmentIntersectionExample.png

Intersection points example.