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

用代码播放背景音乐

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