Prefixes
Prefix
Meaning
Returns
Chainable
🛠️ Set prefix
Set prefixnew Sound(SFX.Explosion)
.SetVolume(0.55f)
.SetRandomPitch() // variation to avoid repetition
.SetSpatialSound(true) // 3D
.SetFadeOut(0.8f) // fade when it ends
.Play();🔔 On prefix
On prefixvar loopingMusic = new Music(Track.ForestAmbience)
.SetLoop(true)
.OnPlay(() => Debug.Log("Ambient started"))
.OnPause(() => Debug.Log("Ambient paused"))
.OnResume(() => Debug.Log("Ambient resumed"))
.OnComplete(() => Debug.Log("Ambient stopped"));
loopingMusic.Play(); // fires OnPlay
// Later…
loopingMusic.Pause(); // fires OnPause
loopingMusic.Resume(); // fires OnResume
loopingMusic.Stop(); // fires OnCompleteLast updated