Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_game_select
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
NJ_game_select
Commits
b2554be0
Commit
b2554be0
authored
May 26, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
f5dceaa0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
NJ_game_select.ts
assets/NJ_game_select/scene/NJ_game_select.ts
+23
-17
No files found.
assets/NJ_game_select/scene/NJ_game_select.ts
View file @
b2554be0
...
@@ -35,24 +35,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -35,24 +35,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
async
startStep1
()
{
async
startStep1
()
{
await
this
.
asyncPlayAudioByUrl
(
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
startAudio
);
await
this
.
asyncPlayAudioByUrl
(
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
startAudio
);
await
asyncDelay
(
0.3
);
await
asyncDelay
(
0.3
);
const
circulate
=
async
()
=>
{
const
circle
=
cc
.
find
(
'
Canvas/step1/pad/circle
'
);
const
circle
=
cc
.
find
(
'
Canvas/step1/pad/circle
'
);
circle
.
active
=
true
;
circle
.
active
=
true
;
const
progress
=
cc
.
find
(
'
Canvas/step1/pad/circle/progress
'
);
const
progress
=
cc
.
find
(
'
Canvas/step1/pad/circle/progress
'
);
const
bar
=
progress
.
getComponent
(
cc
.
ProgressBar
);
const
bar
=
progress
.
getComponent
(
cc
.
ProgressBar
);
bar
.
progress
=
1
;
bar
.
progress
=
1
;
try
{
try
{
await
Promise
.
all
([
await
Promise
.
race
([
this
.
asyncCountDown
(
progress
,
3
),
this
.
asyncCountDown
(
progress
,
3
),
this
.
checkPage
()
this
.
checkPage
()
]);
]);
this
.
step
=
1
;
this
.
step
=
1
;
}
catch
(
error
)
{
}
catch
(
error
)
{
// TODO 三秒内没有检测到对应页码的后续处理; 先加个提示框然后重新检测
this
.
showTips
(
`未检测到对应页面`
);
this
.
showTips
(
`未检测到对应页面`
);
circle
.
active
=
false
;
circle
.
active
=
false
;
await
this
.
startStep1
();
await
circulate
();
}
}
}
}
await
circulate
();
}
async
startStep2
()
{
async
startStep2
()
{
await
Promise
.
all
([
await
Promise
.
all
([
this
.
asyncPlayAudioByUrl
(
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
hotZoneItemArr
[
this
.
currentPartIdx
].
audio_url
),
this
.
asyncPlayAudioByUrl
(
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
hotZoneItemArr
[
this
.
currentPartIdx
].
audio_url
),
...
@@ -80,7 +83,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -80,7 +83,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
// 定时三秒检测
// 定时三秒检测
const
timeout
=
new
Promise
((
resolve
,
reject
)
=>
{
const
timeout
=
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
reject
(
new
Error
(
'
checkpage timeout
'
)),
3000
)
setTimeout
(()
=>
{
window
[
"
courseware
"
].
closeOsmoFingerRead
();
reject
(
new
Error
(
'
checkpage timeout
'
));
},
2800
)
});
});
const
pageId
=
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
pageIdx
;
const
pageId
=
this
.
data
.
pageArr
[
this
.
currentPageIdx
].
pageIdx
;
...
...
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