using UnityEngine; namespace Gley.TrafficSystem.Internal { public static class AIEvents { /// /// Triggered when the driving action of a vehicle changed /// /// index of the vehicle /// new action /// action time public delegate void ChangeDrivingState(int vehicleIndex, TrafficSystem.DriveActions action, float actionValue); public static event ChangeDrivingState onChangeDrivingState; public static void TriggetChangeDrivingStateEvent(int vehicleIndex, TrafficSystem.DriveActions action, float actionValue) { if (onChangeDrivingState != null) { onChangeDrivingState(vehicleIndex, action, actionValue); } } /// /// Triggered when a vehicle changes his state to notify other vehicles about this /// /// index of the vehicle /// collider of the vehicle /// new action public delegate void NotifyVehicles(int vehicleIndex, Collider collider); public static NotifyVehicles onNotifyVehicles; public static void TriggerNotifyVehiclesEvent(int vehicleIndex, Collider collider) { if (onNotifyVehicles != null) { onNotifyVehicles(vehicleIndex, collider); } } /// /// Triggered when a vehicle changed waypoint /// /// index of the vehicle /// new waypoint position /// max possible speed /// blinking required public delegate void ChangeDestination(int vehicleIndex); public static ChangeDestination onChangeDestination; public static void TriggerChangeDestinationEvent(int vehicleIndex) { if (onChangeDestination != null) { onChangeDestination(vehicleIndex); } } } }