Commit c863b38e authored by 李维's avatar 李维

dev commit

parent 2996131e
......@@ -71,7 +71,7 @@ export class Cartoon {
// 播放音乐
_playingNow = []
audioCallback = {}
playAudio = function( key, now = false, callback = null, onplayingCallback?, loop?) {
playAudio = function( key, now = false, callback = null, loop?, onplayingCallback?) {
const audio = this.audio.get(key);
if (audio) {
if (now) {
......@@ -93,10 +93,10 @@ export class Cartoon {
}
if(onplayingCallback){
this.audioCallback[key]["onplaying"] = ()=>{
onplayingCallback && onplayingCallback()
onplayingCallback && onplayingCallback(audio)
}
audio.onplaying = ()=>{
onplayingCallback && onplayingCallback()
onplayingCallback && onplayingCallback(audio)
}
}
audio.play();
......
......@@ -224,6 +224,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.m_enableAutoRunFocus = true;
this.autoRunFocus()
this.initShowCard();
this.g_cartoon.playAudio("sm-run", false ,null, true, (audio)=>{
audio.volume = 0.3
})
}
cleanGameVar(){
......@@ -298,6 +301,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.subscribeMapDownEvent(element.id, ()=>{
if(this.m_enableCamera){
this.m_enableCamera = false;
this.g_cartoon.stopAudio("sm-run")
clearTimeout(this.m_autoFocusID)
this.g_cartoon.playAudio("sm-camera")
this.g_cartoon.getCartoonElement(`card-show`).show(()=>{
......@@ -598,6 +602,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if(imageIndex!=-1){
element.ref.children.splice(imageIndex,1)
}
this.g_cartoon.playAudio("sm-run", false, null, true, (audio)=>{
audio.volume = 0.3
})
callback && callback()
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment