Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP_18
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
OP_18
Commits
e62b0390
Commit
e62b0390
authored
Jan 10, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加数据池
parent
671eabdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
10 deletions
+32
-10
.DS_Store
.DS_Store
+0
-0
OP_18.js
assets/OP_18/scene/OP_18.js
+32
-10
No files found.
.DS_Store
View file @
e62b0390
No preview for this file type
assets/OP_18/scene/OP_18.js
View file @
e62b0390
...
...
@@ -202,10 +202,12 @@ cc.Class({
step
:
null
,
canTouch
:
null
,
dataPool
:
null
,
initData
()
{
// 所有全局变量 默认都是null
this
.
canTouch
=
false
;
this
.
step
=
1
;
this
.
dataPool
=
[];
},
audioBtn
:
null
,
...
...
@@ -569,7 +571,8 @@ cc.Class({
letterAnim
.
play
(
'
anim_A_0
'
);
const
cb
=
()
=>
{
this
.
canTouch
=
true
;
// this.canTouch = true;
this
.
checkShowDataPool
();
letterAnim
.
off
(
'
finished
'
,
cb
)
}
letterAnim
.
on
(
'
finished
'
,
cb
);
...
...
@@ -606,7 +609,8 @@ cc.Class({
letterAnim
.
play
(
'
anim_a_0
'
);
const
cb
=
()
=>
{
this
.
canTouch
=
true
;
// this.canTouch = true;
this
.
checkShowDataPool
();
letterAnim
.
off
(
'
finished
'
,
cb
)
}
letterAnim
.
on
(
'
finished
'
,
cb
);
...
...
@@ -1429,11 +1433,12 @@ cc.Class({
},
photoEnd
(
data
)
{
photoEnd
(
data
,
isPool
=
false
)
{
console
.
log
(
'
this.photo end
'
);
if
(
!
this
.
canTouch
)
{
if
(
!
this
.
canTouch
&&
isPool
==
false
)
{
this
.
dataPool
.
push
(
data
);
console
.
log
(
'
! cantouch
'
)
return
;
}
...
...
@@ -1487,7 +1492,8 @@ cc.Class({
this
.
canTouch
=
false
;
this
.
showStepAudio
();
}
else
{
this
.
canTouch
=
true
;
// this.canTouch = true;
this
.
checkShowDataPool
();
}
// const isFillAll = this.checkIsFillAll(answerData);
...
...
@@ -1533,7 +1539,8 @@ cc.Class({
playAudioStep2
()
{
playAudioByUrl
(
this
.
data
.
write_big_2_audio_url
,
()
=>
{
this
.
canTouch
=
true
;
// this.canTouch = true;
this
.
checkShowDataPool
();
});
},
...
...
@@ -1546,16 +1553,29 @@ cc.Class({
playAudioStep4
()
{
playAudioByUrl
(
this
.
data
.
write_small_2_audio_url
,
()
=>
{
this
.
canTouch
=
true
;
this
.
checkShowDataPool
();
// this.canTouch = true;
});
},
playAudioStep5
()
{
playAudioByUrl
(
this
.
data
.
finish_audio_url
,
()
=>
{
// this.canTouch = true;
});
},
checkShowDataPool
()
{
if
(
this
.
dataPool
.
length
==
0
)
{
this
.
canTouch
=
true
;
return
;
}
const
data
=
this
.
dataPool
.
shift
();
this
.
photoEnd
(
data
,
true
);
},
checkShowStepAudio
()
{
...
...
@@ -1660,7 +1680,8 @@ cc.Class({
const
playEnd
=
()
=>
{
this
.
playAni
(
'
normal
'
,
0
);
this
.
showSmallLetterAnim
();
this
.
canTouch
=
true
;
// this.checkShowDataPool();
// this.canTouch = true;
}
if
(
!
this
.
data
.
write_small_0_audio_url
)
{
...
...
@@ -1695,7 +1716,8 @@ cc.Class({
const
playEnd
=
()
=>
{
this
.
playAni
(
'
normal
'
,
0
);
this
.
canTouch
=
true
;
// this.canTouch = true;
this
.
checkShowDataPool
();
// this.startTesting();
}
...
...
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