AudioManager - Maxodie/BattriKeepel2 GitHub Wiki

Create Sound Instace

The AudioManager can create/destroy a SoundInstance class with the functions:

SoundInstance CreateSoundInstance(bool playOnAwake, bool loop);
void DestroySoundInstance(SoundInstance instance);

Play a basic sound

You need to first, create a SoundInstance and then use SoundInstance.Play(), You need to destroy the instance after using it

AudioClip clip;
// Instance creation
SoundInstance hitSoundInstance = AudioManager.CreateSoundInstance(false, false);
hitSoundInstnace.Play(clip);
// Instance destruction
AudioManager.DestroySoundInstance(hitSoundInstance);

Utilites

From the SoundInstance you can use different functions like Stop``Pause``Resume

⚠️ **GitHub.com Fallback** ⚠️