Audio Manager
Workflow
Audio is entirely managed by the ‘Audio Manager’ component, which is attached the Managers > Audio game object. This component receives audio clips from ‘UI Manager’, manages overall volume via ‘Audio Mixer’, and plays audio clips through ‘Audio Source’.
There are three types of audio mixer groups you can use. For example, you can set ‘Music’ to the ‘Output’ field of any audio source component. If you want to use your own audio mixer, you can assign any of your mixers to the ‘Audio Mixer’ field. Make sure to create groups with the same name as in the image below and expose the parameters.
Scripting
using UnityEngine;
using Michsky.DreamOS; // DreamOS namespace
public class SampleClass : MonoBehaviour
{
[SerializeField] private UIManagerAudio audioManager;
void Start()
{
// Set volume between 0.0001 and 1
audioManager.SetMasterVolume(0.5f);
// Mute or unmute overall audio
audioManager.Mute();
// Enable or disable key strokes
audioManager.EnableStrokes(true);
}
}
How can we help?
A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.