SetIntersectionRoadToGreen
Description
Declaration
public static void SetIntersectionRoadToGreen(string intersectionName, int roadIndex, bool doNotChangeAgain = false)Parameters
Name
Description
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);
}
public void SetRoadToGreen()
{
//change the road 0 of Intersection_2 to green and keep it green.
API.SetIntersectionRoadToGreen("Intersection_2", 0, true);
}
}
Last updated