Commit 400e871a authored by 李维's avatar 李维

用代码播放背景音乐

parent 20356b0b
......@@ -248,7 +248,7 @@
"_mute": false,
"_loop": true,
"_firstlyEnabled": true,
"playOnLoad": true,
"playOnLoad": false,
"preload": false,
"_id": "4d+sz4KE9NiaRazqerNdHs"
},
......
......@@ -305,9 +305,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.showQuestions();
this.playLaba();
this.playBGM();
}
playBGM() {
let music = cc.find('Canvas/bgMusic').getComponent(cc.AudioSource);
music.play()
}
private showQuestions() {
let question = Game.getIns().getCurrentPage();
......
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