Audio Manager
namespace: qASIC.AudioManagment
Introduction
Audio Manager helps you manage audio globally. It allows for global clip access by tags. Every clip gets played globally and moved from scene to scene.
Setup
To enable the manager go to Project Settings/qASIC/Audio
and toggle on 'Enable Audio Manager'. In here you can also change Audio Manager's behaviour and assign a mixer.
The Audio Manager will be automatically on application start by default.
Usage
To play a sound use AudioManager.Play
.
public AudioClip gunSound = new AudioClip();
public void Shoot()
{
AudioData soundData = new AudioData(gunSound);
soundData.replace = true;
//This is going to play a gun sound in channel "weapon"
AudioManager.Play("weapon", gunSound);
}
Changing parameters
In order to make a slider change a parameter add Audio Menu Setting
component to it and specify the name of the parameter. Your slider's min and max values will be changed to 0 and 1 automatically.