Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LWD_3
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
LWD_3
Commits
6e09585c
Commit
6e09585c
authored
Oct 30, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: setInterval --> schedule
parent
273352d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
game.js
play/assets/LWD_3/script/game/game.js
+4
-2
No files found.
play/assets/LWD_3/script/game/game.js
View file @
6e09585c
...
@@ -54,7 +54,9 @@ var game = cc.Class({
...
@@ -54,7 +54,9 @@ var game = cc.Class({
//初始化游戏
//初始化游戏
this
.
initGame
();
this
.
initGame
();
setInterval
(()
=>
{
const
scheduler
=
cc
.
director
.
getScheduler
();
scheduler
.
enableForTarget
(
this
);
scheduler
.
schedule
(()
=>
{
if
(
g
.
data_mgr
.
gameState
==
2
)
{
if
(
g
.
data_mgr
.
gameState
==
2
)
{
return
;
return
;
}
}
...
@@ -63,7 +65,7 @@ var game = cc.Class({
...
@@ -63,7 +65,7 @@ var game = cc.Class({
g
.
data_mgr
.
time
=
0
;
g
.
data_mgr
.
time
=
0
;
this
.
hintPlay
();
this
.
hintPlay
();
}
}
},
1000
);
},
this
,
1
,
cc
.
macro
.
REPEAT_FOREVER
,
0
,
false
);
//监听尺寸变化
//监听尺寸变化
if
(
window
.
addEventListener
)
{
if
(
window
.
addEventListener
)
{
...
...
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