GetTrafficLightsCrossingState
Description
Get the color of the traffic light for vehicles.
Declaration
public static TrafficLightsColor GetTrafficLightsCrossingState(string crossingName)Parameters
Name
Description
crossingName
The name of the street crossing.
Returns
TrafficLightsColor - the color of the traffic light.
Example
using Gley.TrafficSystem;
using UnityEngine;
public class Test : MonoBehaviour
{
//a reference to vehicle pool and player assigned in inspector
public VehiclePool vehiclePool;
public Transform player;
void Start()
{
API.Initialize(player, 20, vehiclePool);
}
void GetCrossingState()
{
Debug.Log(API.GetTrafficLightsCrossingState("Crossing_2"));
}
}
Last updated