For the complete documentation index, see llms.txt. This page is also available as Markdown.

SetEngineVolume

Description

Control the traffic vehicles' engine volume from the master volume.

Declaration

public static void SetEngineVolume(float volume)

Parameters

Name
Description

volume

Current vehicles' engine AudioSource volume.

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 SetVolumeToHalf()
    {
        API.SetEngineVolume(0.5f);
    }
}

Last updated