Prefijos
Prefijo
Significado
Devuelve
Encadenable
🛠️ Prefijo Set
Setnew Sound(SFX.Explosion)
.SetVolume(0.55f)
.SetRandomPitch() // variación para evitar repetición
.SetSpatialSound(true) // 3D
.SetFadeOut(0.8f) // desvanecer al terminar
.Play();🔔 Prefijo On
Onvar 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(); // dispara OnPlay
// Más tarde…
loopingMusic.Pause(); // dispara OnPause
loopingMusic.Resume(); // dispara OnResume
loopingMusic.Stop(); // dispara OnCompleteLast updated