Methods
📌 Summary Table
DynamicMusic()
DynamicMusic
Creates an empty DynamicMusic instance. You must add tracks before playing.
DynamicMusic(Track[]
tracks)
DynamicMusic
Creates a DynamicMusic instance with multiple Track
stems playing together.
DynamicMusic(string[]
tags)
DynamicMusic
Creates a DynamicMusic instance with multiple tracks identified by their tags.
SetAllVolumes(float
volume)
DynamicMusic
Assigns the same initial volume to all tracks before playback.
SetTrackVolume(Track
track, float
volume)
DynamicMusic
Sets the initial volume for the specified Track
.
SetTrackVolume(string
tag, float
volume)
DynamicMusic
Sets the initial volume for the track identified by its tag.
SetHearDistance(float
minHearDistance, float
maxHearDistance)
DynamicMusic
Defines the minimum and maximum hearing distances.
SetVolumeRolloffCurve(VolumeRolloffCurve
curve)
DynamicMusic
Chooses the volume attenuation curve (logarithmic or linear).
SetCustomVolumeRolloffCurve(AnimationCurve
curve)
DynamicMusic
Applies a custom attenuation curve.
ChangeAllVolumes(float
newVolume, float
lerpTime)
void
Changes the volume of all tracks during playback (smooth if lerpTime
> 0).
ChangeTrackVolume(Track
track, float
newVolume, float
lerpTime)
void
Changes the volume of a specific track at runtime.
ChangeTrackVolume(string
tag, float
newVolume, float
lerpTime)
void
Changes the volume of the track identified by tag at runtime.
SetPitch(float
pitch)
DynamicMusic
Adjusts the global pitch for all tracks.
SetDopplerLevel(float
dopplerLevel)
DynamicMusic
Sets the Doppler effect intensity (0–5).
SetId(string
id)
DynamicMusic
Assigns a unique identifier to this instance.
SetLoop(bool
loop)
DynamicMusic
Enables (true
) or disables (false
) looping.
SetClips(Track[]
tracks)
DynamicMusic
Replaces current stems with the provided Track
array.
SetClips(string[]
tags)
DynamicMusic
Replaces current stems with the provided array of tags.
SetPosition(Vector3
position)
DynamicMusic
Sets the 3D world position from which audio emits.
SetFollowTarget(Transform
target)
DynamicMusic
Makes each audio source follow the specified Transform
.
SetSpatialSound(bool
activate)
DynamicMusic
Toggles spatialized 3D audio (true
) or global 2D audio (false
).
SetFadeOut(float
fadeOutTime)
DynamicMusic
Defines a fade-out when stopping all tracks.
SetOutput(Output
output)
DynamicMusic
Routes all stems to the specified AudioMixerGroup.
OnPlay(Action
onPlay)
DynamicMusic
Callback when playback starts.
OnComplete(Action
onComplete)
DynamicMusic
Callback when playback ends or is stopped.
OnLoopCycleComplete(Action
onLoopCycleComplete)
DynamicMusic
Callback at the end of each loop cycle.
OnPause(Action
onPause)
DynamicMusic
Callback when paused.
OnPauseComplete(Action
onPauseComplete)
DynamicMusic
Callback after the pause fade-out finishes.
OnResume(Action
onResume)
DynamicMusic
Callback when playback resumes.
Play(float
fadeInTime)
void
Starts playback of all stems (optional fade-in).
Pause(float
fadeOutTime)
void
Pauses playback with optional fade-out.
Resume(float
fadeInTime)
void
Resumes playback with optional fade-in.
Stop(float
fadeOutTime)
void
Stops playback with optional fade-out.
📘 Detailed Description
DynamicMusic
DynamicMusic()
DynamicMusic
DynamicMusic()Creates an empty DynamicMusic
instance. You must add tracks before calling Play()
.
DynamicMusic
DynamicMusic(Track[]
tracks)
DynamicMusic
DynamicMusic(Track[]
tracks)Constructs the dynamic music with the given Track
array; all stems play simultaneously.
DynamicMusic
DynamicMusic(string[]
tags)
DynamicMusic
DynamicMusic(string[]
tags)Constructs the dynamic music using the specified tags array, one tag per stem.
DynamicMusic
SetAllVolumes(float
volume)
DynamicMusic
SetAllVolumes(float
volume)Assigns the same initial volume (0–1) to all stems.
DynamicMusic
SetTrackVolume(Track
track, float
volume)
DynamicMusic
SetTrackVolume(Track
track, float
volume)Sets the initial volume for the specified track
.
DynamicMusic
SetTrackVolume(string
tag, float
volume)
DynamicMusic
SetTrackVolume(string
tag, float
volume)Sets the initial volume for the stem identified by its tag
.
DynamicMusic
SetHearDistance(float
minHearDistance, float
maxHearDistance)
DynamicMusic
SetHearDistance(float
minHearDistance, float
maxHearDistance)Defines the distance at which the audio is fully audible and the distance at which it begins to fade.
DynamicMusic
SetVolumeRolloffCurve(VolumeRolloffCurve
curve)
DynamicMusic
SetVolumeRolloffCurve(VolumeRolloffCurve
curve)Chooses between Logarithmic or Linear distance-based attenuation.
DynamicMusic
SetCustomVolumeRolloffCurve(AnimationCurve
customCurve)
DynamicMusic
SetCustomVolumeRolloffCurve(AnimationCurve
customCurve)Applies a custom AnimationCurve
for precise attenuation control.
void
ChangeAllVolumes(float
newVolume, float
lerpTime)
void
ChangeAllVolumes(float
newVolume, float
lerpTime)Changes the volume of all stems in real time; if lerpTime
> 0, transitions smoothly.
void
ChangeTrackVolume(Track
track, float
newVolume, float
lerpTime)
void
ChangeTrackVolume(Track
track, float
newVolume, float
lerpTime)Changes the volume of a specific stem identified by track
.
void
ChangeTrackVolume(string
tag, float
newVolume, float
lerpTime)
void
ChangeTrackVolume(string
tag, float
newVolume, float
lerpTime)Changes the volume of a specific stem identified by tag
.
DynamicMusic
SetPitch(float
pitch)
DynamicMusic
SetPitch(float
pitch)Applies a global pitch (affects tone and speed) to all stems.
DynamicMusic
SetDopplerLevel(float
dopplerLevel)
DynamicMusic
SetDopplerLevel(float
dopplerLevel)Adjusts the Doppler effect intensity (0–5).
DynamicMusic
SetId(string
id)
DynamicMusic
SetId(string
id)Assigns a unique identifier for management via SoundsGoodManager
.
DynamicMusic
SetLoop(bool
loop)
DynamicMusic
SetLoop(bool
loop)Enables (true
) or disables (false
) infinite looping of all stems.
DynamicMusic
SetClips(Track[]
tracks)
DynamicMusic
SetClips(Track[]
tracks)Replaces all current stems with the provided Track
array.
DynamicMusic
SetClips(string[]
tags)
DynamicMusic
SetClips(string[]
tags)Replaces all current stems with the provided tags array.
DynamicMusic
SetPosition(Vector3
position)
DynamicMusic
SetPosition(Vector3
position)Sets the 3D position from which the audio is emitted.
DynamicMusic
SetFollowTarget(Transform
target)
DynamicMusic
SetFollowTarget(Transform
target)Makes each audio source follow the specified Transform
.
DynamicMusic
SetSpatialSound(bool
activate)
DynamicMusic
SetSpatialSound(bool
activate)Toggles spatial 3D audio (true
) or global 2D audio (false
).
DynamicMusic
SetFadeOut(float
fadeOutTime)
DynamicMusic
SetFadeOut(float
fadeOutTime)Defines the fade-out duration when stopping all stems.
DynamicMusic
SetOutput(Output
output)
DynamicMusic
SetOutput(Output
output)Routes stems to a specific output channel in the Audio Mixer.
DynamicMusic
OnPlay(Action
onPlay)
DynamicMusic
OnPlay(Action
onPlay)Callback invoked when dynamic music playback begins.
DynamicMusic
OnComplete(Action
onComplete)
DynamicMusic
OnComplete(Action
onComplete)Callback invoked when playback ends or is manually stopped.
DynamicMusic
OnLoopCycleComplete(Action
onLoopCycleComplete)
DynamicMusic
OnLoopCycleComplete(Action
onLoopCycleComplete)Invoked at the end of each loop cycle if looping is active.
DynamicMusic
OnPause(Action
onPause)
DynamicMusic
OnPause(Action
onPause)Callback invoked immediately when playback is paused.
DynamicMusic
OnPauseComplete(Action
onPauseComplete)
DynamicMusic
OnPauseComplete(Action
onPauseComplete)Invoked after the pause fade-out completes.
DynamicMusic
OnResume(Action
onResume)
DynamicMusic
OnResume(Action
onResume)Callback invoked when playback resumes after a pause.
void
Play(float
fadeInTime)
void
Play(float
fadeInTime)Plays all stems simultaneously. If fadeInTime
> 0, applies a fade-in.
void
Pause(float
fadeOutTime)
void
Pause(float
fadeOutTime)Pauses all stems; if fadeOutTime
> 0, fades out before pausing.
void
Resume(float
fadeInTime)
void
Resume(float
fadeInTime)Resumes all stems with optional fade-in.
void
Stop(float
fadeOutTime)
void
Stop(float
fadeOutTime)Stops all stems with optional fade-out; if zero, stops immediately.
Last updated