public class MusicManager
extends java.lang.Object
| Constructor and Description |
|---|
MusicManager(@NotNull AudioFileLoader audioFileLoader,
@Nullable DebugWriter debugSound)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
play(@Nullable java.lang.CharSequence name)
Plays the given music.
|
void |
setEnabled(boolean enabled)
Sets whether background music is enabled.
|
void |
setMuted(boolean muted)
Sets whether background music is muted.
|
void |
shutdown()
Terminates a playing background music and free resources.
|
public MusicManager(@NotNull
@NotNull AudioFileLoader audioFileLoader,
@Nullable
@Nullable DebugWriter debugSound)
audioFileLoader - the audio file loader for loading audio filesdebugSound - the writer for logging sound related information or
null to not logpublic void play(@Nullable
@Nullable java.lang.CharSequence name)
name - the music name, or null to stop playing musicpublic void setEnabled(boolean enabled)
enabled - whether background music is enabledpublic void setMuted(boolean muted)
muted - whether background music is mutedpublic void shutdown()