Music
๐ How to create a Music object
Music objectnew Music("MainTheme").Play(); new Music(Track.MainTheme).Play();Music mainTheme = new Music("MainTheme").SetVolume(0.6f)
.SetLoop(true).SetSpatialSound(false);
mainTheme.Play(); ๐ Advanced Example
Music dungeonTheme = new Music(Track.Dungeon)
.SetVolume(0.4f)
.SetLoop(true) // Loops the track when it ends
.SetFadeOut(2.5f) // 2.5-second fade-out at the end
.SetOutput(Output.Music) // Assigns it to a specific output channel
.OnPause(() => Debug.Log("Dungeon theme paused"))
.Play(); Last updated