SetPriorityCrossingStopState

Description

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

Declaration

 public static void SetPriorityCrossingStopState(string crossingName, bool stop, bool stopUpdate = true)

Parameters

NameDescription

crossingName

The name of the street crossing.

stop

Stop the vehicles.

stopUpdate

Currently not used, no automatic update implemented.

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 SetCrossingToRed()
    {
        //change the Crossing_2 to red - vehicles will stop, and pedestrians should cross now
        API.SetPriorityCrossingStopState("Crossing_2", true, true);
    }
}

Last updated