Commit f967aa90 authored by linzhiguo's avatar linzhiguo

+ 再尝试一下

parent 95b7686e
This diff is collapsed.
...@@ -162,6 +162,18 @@ cc.Class({ ...@@ -162,6 +162,18 @@ cc.Class({
this.initView(); this.initView();
}, },
startAudio(){
let audio_url = this.data.audio_url;
if (audio_url && audio_url!=""){
playAudioByUrl(audio_url, ()=>{
this.playGame();
});
}
else{
this.playGame();
}
},
initView() { initView() {
window.WL = this; window.WL = this;
this.shuffle(this.data.mouses); this.shuffle(this.data.mouses);
...@@ -173,21 +185,16 @@ cc.Class({ ...@@ -173,21 +185,16 @@ cc.Class({
this.updateFlagArea(); this.updateFlagArea();
this.title.string = this.data.title; this.title.string = this.data.title;
let audio_url = this.data.audio_url;
this._start = cc.find('Canvas/start');
this._start.on('click',()=>{
this._start.active = false;
if (audio_url && audio_url!=""){ if (window && window.courseware) {
playAudioByUrl(audio_url, ()=>{ window.courseware.onEvent("course-in-screen", (data, next) => {
this.playGame(); this.startAudio();
next();
}); });
} }
else{ else{
this.playGame(); this.startAudio();
} }
});
......
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