Can play Sound from a map script

add sound in the TutoMap
This commit is contained in:
DESKTOP-FMM8UI0\CLV 2021-04-21 16:47:19 +02:00
parent 676dbcc9d0
commit 517c0e86cb
6 changed files with 92 additions and 0 deletions

View file

@ -5,6 +5,12 @@ var targetObjectTutoBubble ='Tutobubble';
var targetObjectTutoChat ='tutoChat';
var targetObjectTutoExplanation ='tutoExplanation';
var popUpExplanation = undefined;
var enterSoundUrl = "/resources/objects/webrtc-in.mp3";
var exitSoundUrl = "/resources/objects/webrtc-out.mp3";
var soundConfig = {
volume : 0.5,
loop : false
}
function launchTuto (){
WA.openPopup(targetObjectTutoBubble, textFirstPopup, [
{
@ -43,6 +49,8 @@ function launchTuto (){
WA.onEnterZone('popupZone', () => {
WA.displayBubble();
WA.playSound(enterSoundUrl,soundConfig);
if (!isFirstTimeTuto) {
isFirstTimeTuto = true;
launchTuto();
@ -71,4 +79,6 @@ WA.onEnterZone('popupZone', () => {
WA.onLeaveZone('popupZone', () => {
if (popUpExplanation !== undefined) popUpExplanation.close();
WA.removeBubble();
WA.playSound(exitSoundUrl,soundConfig);
})