- Easy to manage all your audios in one Scriptable Object file
- Easy to access via code
- Offering even more methods, and each of them with its own use case
- Download this project, and add them to your own one
- Create a new empty gameObject named "AudioManager", and attach an AudioManager component to it
- Go to "Assets > Create > Scriptable Objects > Audio Manager Data" to create a new file to manage your audios' data
- Next, add a new audio to the array list providing as well all the information needed for the audio
- Go to AudioManager gameObject, and add the reference to the AudioManager Data you just created
- Finally, simply play the audio with this line of code
// The name of the audio we want to play
string audioName = "Button";
// Play the audio. Note: the audio will be destroyed once completed playing
AudioManager.Instance.Play(audioName);
