UpdateVehicleLights

Description

Turn all vehicle lights on or off.

Declaration

public static void UpdateVehicleLights(bool on)

Parameters

NameDescription

on

If true, vehicle lights are on

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 TurnLightsOn()
    {
        API.UpdateVehicleLights(true);
    }

    public void TurnLightsOff()
    {
        API.UpdateVehicleLights(false);
    }
}

Last updated