RemoveVehicleControl
Description
Completely remove a vehicle from the Traffic System. Scripts will no longer interact with the vehicle sent as parameter.
Declaration
public static void RemoveVehicleControl(int vehicleIndex)Parameters
Name
Description
vehicleIndex
The index of the vehicle to be removed.
Example
using Gley.TrafficSystem;
using UnityEngine;
public class Test : MonoBehaviour
{
private void Update()
{
if (Input.GetKeyDown(KeyCode.Alpha0))
{
API.RemoveVehicleControl(0);
}
if (Input.GetKeyDown(KeyCode.Alpha1))
{
API.AddVehicleControl(0);
}
}
}
Last updated