Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wukong_finger
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
wukong_finger
Commits
d8219af0
Commit
d8219af0
authored
Oct 17, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
85fc32d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
147 additions
and
110 deletions
+147
-110
wukong_finger.js
assets/wukong_finger/scene/wukong_finger.js
+147
-110
No files found.
assets/wukong_finger/scene/wukong_finger.js
View file @
d8219af0
...
...
@@ -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() {
curVideoPlay
End
()
{
curVideoPlay
OnEndTime
()
{
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
.
curVideoPlay
End
();
this
.
curVideoPlay
OnEndTime
();
}
...
...
@@ -2794,7 +2827,11 @@ showStartLight() {
if
(
this
.
quesIndex
==
0
)
{
// 封面特殊处理
this
.
startQuesVideo
();
// this.startQuesVideo();
delayCall
(
0.1
,
()
=>
{
this
.
video
.
play
();
})
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment