Properties
π Summary Table
Using
bool
True if the music is in use, even if it's paused.
Playing
bool
True if the music is currently playing.
Paused
bool
True if the music is paused, ignoring any fade out.
Volume
float
Current music volume (value between 0 and 1).
ClipIndex
int
Index of the playing clip. Returns -1 if there's none selected.
PlayingTime
float
Total time (in seconds) the music has been playing.
CurrentLoopCycleTime
float
Current time (in seconds) of the loop cycle being played.
CompletedLoopCycles
int
Number of completed loop cycles.
ClipDuration
float
Total duration of the currently playing clip.
Clip
AudioClip
The current music clip being played.
π Detailed Description
bool
Using
bool
UsingReturns true
if the music is in use. This includes both active playback and cases where the music has been paused but is still assigned to an AudioSource
.
bool
Playing
bool
PlayingReturns true
if the music is actively playing at the moment. If itβs paused or stopped, this property will be false
.
bool
Paused
bool
PausedReturns true
if the music is paused. Unlike Playing
, this property ignores any fade out
effect and focuses solely on the actual playback state.
float
Volume
float
VolumeRepresents the current volume level of the music. Its value is normalized between 0
(silent) and 1
(maximum volume).
int
ClipIndex
int
ClipIndexIndicates the index of the currently playing clip within the available clip set for that music track. If none is selected, it returns -1
.
float
PlayingTime
float
PlayingTimeIndicates the total time (in seconds) the music has been playing since it was last started.
float
CurrentLoopCycleTime
float
CurrentLoopCycleTimeReturns the time the current loop cycle has been playing. If the music is not looping, this value will match the total play time.
int
CompletedLoopCycles
int
CompletedLoopCyclesNumber of times the music has completed a full loop cycle. This property only increases when looping is enabled.
float
ClipDuration
float
ClipDurationTotal duration in seconds of the clip currently being played. If no clip is assigned, the value will be 0
.
AudioClip
Clip
AudioClip
ClipDirect reference to the AudioClip
currently playing as music. This allows you to access its properties or compare it with other clips if needed.
Last updated