Audio objects
Audio objects are instances you create from code to play the sounds or music you previously registered in Audio Creator. Each class encapsulates specific rules and behaviours and offers a fluent, method-chaining API.
Sound
A single SFX (footstep, shot, UI clickβ¦) that might play many times.
Any kind of sound effect.
Music
One music track (ambient, boss themeβ¦) that can loop.
Constant background music.
Playlist
A sequential queue of tracks; plays in order, supports shuffle, fade-in/out and per-track callbacks.
Background music made of several tracks in succession.
DynamicMusic
Several tracks playing in parallel, letting you add/remove layers (drums, strings, SFX) according to gameplay.
Reactive dynamic music.
π§° Key concepts
Fluent API β Every setter returns the same instance, so you can chain configuration and the final
Play()
in one sentence.Automatic Object Pooling β Internally, each object requests a
SoundsGoodAudioSource
from the pool, avoiding runtime instantiation.Callbacks (
OnPlay
,OnComplete
, etc.) β Hook gameplay logic (screen shake, particles, achievements) without coroutines orInvoke
.Volume persistence β If you assign an
Output
, its level is saved toPlayerPrefs
; Output Manager restores it on start-up.
π Recommended lifecycle
Create
Play / control
Finish
When it ends (
OnComplete
), the object returns itsAudioSource
to the pool.The class instance stays alive; you can reconfigure it and call
Play()
again.
π Tip: Donβt instantiate an audio object every frame; keep references if youβll reuse the same SFX (footsteps, rapid fire, etc.).
π Next step
Dive into each audio object to master every feature:
Last updated