Building In Trigger
Description
Controls how the traffic vehicle reacts when a building is in the trigger.
Declaration
public delegate void BuildingInTrigger(int vehicleIndex, Collider building);Parameters
Name
Description
vehicleIndex
The index of the vehicle that saw the building.
building
The collider of the building.
Set Method
public static void SetBuildingInTrigger(BuildingInTrigger buildingInTriggerDelegate)Example
using Gley.TrafficSystem;
using UnityEngine;
public class Test : MonoBehaviour
{
private void Start()
{
Delegates.SetBuildingInTrigger(MyBuildingBehaviour);
}
public static void MyBuildingBehaviour(int vehicleIndex, Collider player)
{
//do avoid maneuvers
API.AddDrivingAction(vehicleIndex, DriveActions.AvoidReverse, false);
}
}Last updated