Commit bddd536d authored by Tt's avatar Tt

修改默认情况下点击音效bug

parent 498f083e
No preview for this file type
...@@ -120,15 +120,21 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -120,15 +120,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.lastTime = new Date().getTime(); this.lastTime = new Date().getTime();
this.rightList = []; this.rightList = [];
this.onTouchAudio().then(() => { this.onTouchAudio(false).then(() => {
this.inited = true;
this.startQuestion(); this.startQuestion();
}) })
} }
@property(cc.Node) @property(cc.Node)
btn_laba: cc.Node = null; btn_laba: cc.Node = null;
onTouchAudio() {
private inited: boolean;
onTouchAudio(isClick) {
return new Promise(res => { return new Promise(res => {
if (isClick && !this.inited) {
return;
}
this.btn_laba.getComponent(ImgVoice).playVoiceStart(); this.btn_laba.getComponent(ImgVoice).playVoiceStart();
pg.audio.playAudioByUrl(this.currentQuestion.questionAudio).then(() => { pg.audio.playAudioByUrl(this.currentQuestion.questionAudio).then(() => {
this.btn_laba.getComponent(ImgVoice).playVoiceEnd(); this.btn_laba.getComponent(ImgVoice).playVoiceEnd();
......
{
"ver": "1.1.2",
"uuid": "56a6d8e2-ecd9-4d82-ab7a-2f845311d68c",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
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