Commit 081f1b63 authored by 李维's avatar 李维

修复某些情况下小猫不说话的问题

parent 2309dc1f
......@@ -237,8 +237,12 @@ cc.Class({
refreshCoolCatPosition() { },
jumpToQuestion(questionIdx) {
const cat = cc.find("Canvas/bg/catFrame/CoolCat");
const questionAudioUrl = this.data.question_arr[questionIdx].audio_url;
this.playAudioByUrl(questionAudioUrl);
playDragonBoneAnimation(cat, "begin", -1);
this.playAudioByUrl(questionAudioUrl, ()=>{
playDragonBoneAnimation(cat, "normal", -1);
});
const box = cc.find("Canvas/bg/box");
box.removeAllChildren();
......@@ -298,7 +302,11 @@ cc.Class({
optionNode.zIndex = selectedNum;
this.optionJump(optionNode);
this.playAudioByUrl(optionNode.optionData.audio_url);
const cat = cc.find("Canvas/bg/catFrame/CoolCat");
playDragonBoneAnimation(cat, "begin", -1);
this.playAudioByUrl(optionNode.optionData.audio_url, ()=>{
playDragonBoneAnimation(cat, "normal", -1);
});
});
console.log('optionNode.on(cc.Node.EventType.TOUCH_MOVE, (event) => {')
optionNode.on(cc.Node.EventType.TOUCH_MOVE, (event) => {
......
import { RandomInt } from "../script/util";
import { RandomInt, playDragonBoneAnimation } from "../script/util";
cc.Class({
extends: cc.Component,
......@@ -33,7 +33,11 @@ cc.Class({
if (isSelf) {
const idx = this._resultList.findIndex(result => result.isSelf == true);
if (idx != -1) {
this.playAudioByUrl(this._finishAudioList[idx]);
const cat = cc.find("resultNode/catFrame/CoolCat");
playDragonBoneAnimation(cat, "begin", -1);
this.playAudioByUrl(this._finishAudioList[idx], ()=>{
playDragonBoneAnimation(cat, "normal", -1);
});
}
}
},
......
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