Commit d8219af0 authored by limingzhe's avatar limingzhe

fix: debug

parent 85fc32d4
......@@ -767,8 +767,8 @@ initMask() {
// this.readingItemArr = this.curQues.readingItemArr;
// this.readingItemArrIndex = 0;
this.readingItemArr = this.curQues.readingItemArr;
this.readingItemArrIndex = 0;
// playAudio(this.readingTip2Clip, () => {
// this.showReadingItem();
......@@ -841,6 +841,7 @@ initMask() {
this.readingPanel = readingPanel
this.readingPanelCenter = cc.find("panel", readingPanel);
this.readingPanelCenter.baseScale = this.readingPanelCenter.scale;
this.readingPanelBg = cc.find("panel/bg_2", readingPanel);
......@@ -937,9 +938,7 @@ initMask() {
this.finishBtn.active = false;
if (!this.readingPanelCenter.baseScale) {
this.readingPanelCenter.baseScale = this.readingPanelCenter.scale;
}
const baseScale = this.readingPanelCenter.baseScale;
......@@ -955,29 +954,33 @@ initMask() {
.to(0.3, {scale: 0}, {easing: "cubicOut"})
.call(() => {
this.stopRecordToText();
this.readingItemArrIndex ++ ;
this.showReadingItem();
// this.stopRecordToText();
// this.readingItemArrIndex ++ ;
// this.showReadingItem();
if (this.curReadingItem) {
showFunc();
} else {
// if (this.curReadingItem) {
// showFunc();
// } else {
this.readingPanel.active = false;
}
this.readingPanelCenter.scale = baseScale;
// }
})
.start();
}
hideFunc();
// // this.readingPanel.active = false;
// this.readingPanel.active = false;
// this.stopRecordToText();
this.stopRecordToText();
// this.readingItemArrIndex ++ ;
this.readingItemArrIndex ++ ;
// this.showReadingItem();
......@@ -987,13 +990,13 @@ initMask() {
// this.initCurReadingItem();
// this.initCurQuesReadingItem();
this.initCurQuesReadingItem();
// if (this.isGameEnd) {
// return;
// }
if (this.isGameEnd) {
return;
}
// this.video.play();
this.video.play();
},
......@@ -1627,36 +1630,36 @@ showStartLight() {
startQuesVideo(currentTime = null) {
this.curQues.ques_start = 0;
this.curQues.ques_end = this.video.getDuration() - 0.1;
// this.curQues.ques_start = 0;
// this.curQues.ques_end = this.video.getDuration() - 0.1;
console.log(' in startQuesVideo')
this.wrongTimes = 0;
// console.log(' in startQuesVideo')
// this.wrongTimes = 0;
const video = this.video;
video.node.name = 'ques_video';
// const video = this.video;
// video.node.name = 'ques_video';
console.log("this.curQues: ", this.curQues);
// console.log("this.curQues: ", this.curQues);
// if (currentTime) {
// video.currentTime = currentTime;
// } else {
// video.currentTime = Number(this.curQues.ques_start);
// }
// // if (currentTime) {
// // video.currentTime = currentTime;
// // } else {
// // video.currentTime = Number(this.curQues.ques_start);
// // }
if (this.curQues) {
this.curEndTime = Number(this.curQues.ques_end);
}
// if (this.curQues) {
// this.curEndTime = Number(this.curQues.ques_end);
// }
delayCall(0.1, () => {
video.play();
})
// delayCall(0.1, () => {
// video.play();
// })
},
......@@ -1699,91 +1702,91 @@ showStartLight() {
}
},
continueWaitVideo() {
console.log(' in continueWaitVideo ')
// console.log(' in continueWaitVideo ')
this.video.currentTime = Number(this.curQues.wait_start);
this.curEndTime = Number(this.curQues.wait_end);
// this.video.currentTime = Number(this.curQues.wait_start);
// this.curEndTime = Number(this.curQues.wait_end);
delayCall(0.01, () => {
this.video.play();
})
// delayCall(0.01, () => {
// this.video.play();
// })
},
startRightVideo() {
console.log(' in startRightVideo ')
// const videoNode = this.curQues?.videoObj?.right_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
// video.node.name = 'right_video';
// video.play();
// // const videoNode = this.curQues?.videoObj?.right_video;
// // const video = videoNode.getComponent(cc.VideoPlayer);
// // video.node.name = 'right_video';
// // video.play();
// this.curVideo = video;
// this.resetVideoPos(videoNode);
// // this.curVideo = video;
// // this.resetVideoPos(videoNode);
const video = this.video;
video.node.name = 'right_video';
video.currentTime = Number(this.curQues.right_start);
this.curEndTime = Number(this.curQues.right_end);
// const video = this.video;
// video.node.name = 'right_video';
// video.currentTime = Number(this.curQues.right_start);
// this.curEndTime = Number(this.curQues.right_end);
delayCall(0.01, () => {
video.play();
})
// delayCall(0.01, () => {
// video.play();
// })
},
startWrongVideo() {
console.log(' in startWrongVideo ')
// const videoNode = this.curQues?.videoObj?.wrong_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
// video.node.name = 'wrong_video';
// video.play();
// // const videoNode = this.curQues?.videoObj?.wrong_video;
// // const video = videoNode.getComponent(cc.VideoPlayer);
// // video.node.name = 'wrong_video';
// // video.play();
// this.curVideo = video;
// this.resetVideoPos(videoNode);
// // this.curVideo = video;
// // this.resetVideoPos(videoNode);
const video = this.video;
video.node.name = 'wrong_video';
// const video = this.video;
// video.node.name = 'wrong_video';
if (this.wrongStartTime && this.wrongEndTime) {
video.currentTime = this.wrongStartTime;
this.curEndTime = this.wrongEndTime;
} else {
video.currentTime = Number(this.curQues.wrong_start);
this.curEndTime = Number(this.curQues.wrong_end);
}
// if (this.wrongStartTime && this.wrongEndTime) {
// video.currentTime = this.wrongStartTime;
// this.curEndTime = this.wrongEndTime;
// } else {
// video.currentTime = Number(this.curQues.wrong_start);
// this.curEndTime = Number(this.curQues.wrong_end);
// }
delayCall(0.01, () => {
video.play();
})
// delayCall(0.01, () => {
// video.play();
// })
},
startEndVideo() {
console.log(' in startEndVideo ')
// const videoNode = this.curQues?.videoObj?.end_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
// video.node.name = 'end_video';
// video.play();
// // const videoNode = this.curQues?.videoObj?.end_video;
// // const video = videoNode.getComponent(cc.VideoPlayer);
// // video.node.name = 'end_video';
// // video.play();
// this.curVideo = video;
// this.resetVideoPos(videoNode);
// // this.curVideo = video;
// // this.resetVideoPos(videoNode);
if (!this.curQues.end_start) {
this.checkNextQues();
return;
}
// if (!this.curQues.end_start) {
// this.checkNextQues();
// return;
// }
const video = this.video;
video.node.name = 'end_video';
video.currentTime = Number(this.curQues.end_start);
this.curEndTime = Number(this.curQues.end_end);
delayCall(0.01, () => {
video.play();
})
// const video = this.video;
// video.node.name = 'end_video';
// video.currentTime = Number(this.curQues.end_start);
// this.curEndTime = Number(this.curQues.end_end);
// delayCall(0.01, () => {
// video.play();
// })
},
resetVideoPos(videoNode) {
......@@ -1805,14 +1808,14 @@ showStartLight() {
},
initCurReadingItem() {
this.curReadingItem = this.readingItemArr[this.readingItemArrIndex];
// this.curReadingItem = this.readingItemArr[this.readingItemArrIndex];
if (!this.curReadingItem) {
this.gameEnd();
return;
}
// if (!this.curReadingItem) {
// this.gameEnd();
// return;
// }
this.curEndTime = this.curReadingItem.time;
// this.curEndTime = this.curReadingItem.time;
},
......@@ -1934,13 +1937,30 @@ showStartLight() {
}
console.log('this.curQues.readingItemArr: ', this.curQues.readingItemArr);
if (this.curQues.readingItemArr && this.curQues.readingItemArr.length > 0) {
this.readingItemArr = this.curQues.readingItemArr;
this.readingItemArrIndex = 0;
playAudio(this.readingTip2Clip, () => {
this.showReadingItem();
playAudio(this.readingTip2Clip, async () => {
this.video.currentTime = 0;
this.video.play();
await asyncDelay(0.01);
this.initCurQuesReadingItem();
// this.showReadingItem();
})
// this.showReadingItem();
......@@ -2107,8 +2127,7 @@ showStartLight() {
showReadingItem() {
console.log(' showCurReadingText ... 2 ')
this.initCurQuesReadingItem();
if (!this.curReadingItem) {
this.curQues.readingItemArr = null;
......@@ -2120,17 +2139,19 @@ showStartLight() {
this.initReadingSound();
this.readingPanel.active = true;
this.readingPanelCenter.scale = this.readingPanelCenter.baseScale;
this.finishBtn.active = true;
playAudio(this.readingTipClip, () => {
// playAudioByUrl(this.curReadingAudioUrl, () => {
// this.recordIconStart();
this.recordIconStart();
// this.startRecordToText();
this.startRecordToText();
this.readingSoundBtnClick();
// this.readingSoundBtnClick();
// })
})
......@@ -2142,10 +2163,11 @@ showStartLight() {
if (!this.curReadingItem) {
// this.gameEnd();
this.curQues.readingItemArr = null;
return;
}
// this.curEndTime = this.curReadingItem.time;
this.curEndTime = this.curReadingItem.time;
},
......@@ -2265,6 +2287,8 @@ showStartLight() {
showCurReadingLabelColor() {
console.log(' in showCurReadingLabelColor')
const normalColor = '#c48814';
const readEndColor = '#37bafe'
let str = "";
......@@ -2288,6 +2312,11 @@ showStartLight() {
str += `"<color=${wordColor}>${this.readingWordArr[i]}</color>"`;
}
console.log('this.readingWordArr~: ' + JSON.stringify(this.readingWordArr));
console.log('this.readingEndWordArr~: ' + JSON.stringify(this.readingEndWordArr));
console.log(' showCurReadingText ... 1 ')
this.showCurReadingText(str);
......@@ -2359,8 +2388,12 @@ showStartLight() {
curVideoPlayEnd() {
curVideoPlayOnEndTime() {
console.log(" in curVideoPlayOnEndTime")
this.showReadingItem();
return;
if (this.playTimes && this.playTimes == 1) {
......@@ -2496,7 +2529,7 @@ showStartLight() {
updateCheckStop() {
return;
// return;
if (!this.video || this.curEndTime == -1) {
return;
......@@ -2510,7 +2543,7 @@ showStartLight() {
this.curEndTime = -1;
this.curVideoPlayEnd();
this.curVideoPlayOnEndTime();
}
......@@ -2794,7 +2827,11 @@ showStartLight() {
if (this.quesIndex == 0) {
// 封面特殊处理
this.startQuesVideo();
// this.startQuesVideo();
delayCall(0.1, () => {
this.video.play();
})
return;
}
......
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