ExcludeVehicleFromSystem
Description
An excluded vehicle will never be instantiated again by the Traffic System after it is removed from the scene.
To instantiate again an excluded vehicle check AddExcludedVehicle or AddExcludedVehicleToSystem
Declaration
public static void ExcludeVehicleFromSystem(int vehicleIndex)Parameters
Name
Description
vehicleIndex
Index of the vehicle to be excluded from the system.
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 ExcludeVehicle()
{
API.ExcludeVehicleFromSystem(0);
}
}
Last updated