AddExcludedVehicleToSystem

Description

The AddExcludedVehicleToSystem adds a previously excluded vehicle back to the Traffic System and the vehicle behaves normally.

Declaration

public static void AddExcludedVehicleToSystem(int vehicleIndex)

Parameters

NameDescription

vehicleIndex

Index of the vehicle to be added back to 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 AddVehicle()
    {
        //0 - is an example index of the vehicle
        API.AddExcludedVehicleToSystem(0);
    }
}

Last updated