Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbox_tracingLetters
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
Sbox_tracingLetters
Commits
84bb8b55
Commit
84bb8b55
authored
Dec 19, 2021
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 释放定时器
parent
62258fdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
Sbox_tracingLetters.js
assets/Sbox_tracingLetters/scene/Sbox_tracingLetters.js
+19
-5
No files found.
assets/Sbox_tracingLetters/scene/Sbox_tracingLetters.js
View file @
84bb8b55
...
...
@@ -274,7 +274,21 @@ cc.Class({
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
_timeoutIds
:
null
,
_intervalIds
:
null
,
// 生命周期
onDestroy
()
{
this
.
_timeoutIds
.
forEach
(
id
=>
{
clearTimeout
(
id
);
});
this
.
_intervalIds
.
forEach
(
id
=>
{
clearInterval
(
id
);
});
},
onLoad
()
{
this
.
_timeoutIds
=
[];
this
.
_intervalIds
=
[];
},
ctor
()
{
this
.
_imageResList
=
[];
...
...
@@ -386,9 +400,9 @@ cc.Class({
this
.
sharkNode
=
null
;
}
this
.
createLetterPage
(
this
.
letter
);
setTimeout
(()
=>
{
this
.
_timeoutIds
(
setTimeout
(()
=>
{
this
.
_enableRestart
=
true
;;
},
1000
);
},
1000
)
)
;
// this.loadNextLetter()
// this.updateArrows(this._status.currentStrokeIdx);
// this.onSharkMoveEnd(event, 1);
...
...
@@ -1200,14 +1214,14 @@ cc.Class({
btnNext
.
opacity
=
125
;
switch_b2s
.
opacity
=
125
;
switch_s2b
.
opacity
=
125
;
setTimeout
(()
=>
{
this
.
_timeoutIds
(
setTimeout
(()
=>
{
this
.
_disableButtons
=
false
;
btn_restart
.
opacity
=
255
;
btnBefore
.
opacity
=
255
;
btnNext
.
opacity
=
255
;
switch_b2s
.
opacity
=
255
;
switch_s2b
.
opacity
=
255
;
},
time
*
1000
);
},
time
*
1000
)
)
;
},
pageFlyOut
()
{
...
...
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