parameter soundConfig is now optionnal
if user call mySound.play() the sound will be played with the base SoundConfig
This commit is contained in:
parent
f03f8076f3
commit
b79d76fc2e
3 changed files with 37 additions and 18 deletions
|
@ -15,7 +15,7 @@ const isSoundConfig =
|
|||
export const isPlaySoundEvent =
|
||||
new tg.IsInterface().withProperties({
|
||||
url: tg.isString,
|
||||
config : isSoundConfig,
|
||||
config : tg.isOptional(isSoundConfig),
|
||||
}).get();
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,11 +24,10 @@ class SoundManager {
|
|||
return soundPromise;
|
||||
}
|
||||
|
||||
public async playSound(loadPlugin: LoaderPlugin, soundManager : BaseSoundManager, soundUrl: string, config: SoundConfig) : Promise<void> {
|
||||
public async playSound(loadPlugin: LoaderPlugin, soundManager : BaseSoundManager, soundUrl: string, config: SoundConfig|undefined) : Promise<void> {
|
||||
const sound = await this.loadSound(loadPlugin,soundManager,soundUrl);
|
||||
sound.play(config);
|
||||
|
||||
|
||||
if (config === undefined) sound.play();
|
||||
else sound.play(config);
|
||||
}
|
||||
|
||||
public stopSound(soundManager : BaseSoundManager,soundUrl : string){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue