Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OPW25
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
OPW25
Commits
a9260f8f
Commit
a9260f8f
authored
Dec 06, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:timeout
parent
b7b04aa8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
OPW25.js
play/assets/OPW25/scene/OPW25.js
+20
-7
No files found.
play/assets/OPW25/scene/OPW25.js
View file @
a9260f8f
...
...
@@ -16,6 +16,8 @@ cc.Class({
// 生命周期 onLoad
onLoad
()
{
this
.
_timeoutIds
=
[];
this
.
_intervalIds
=
[];
this
.
initSceneData
();
this
.
initSize
();
},
...
...
@@ -372,9 +374,9 @@ cc.Class({
createStarAni
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
showStar
();
setTimeout
(()
=>
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
resolve
(
''
);
},
500
);
},
500
)
)
;
});
},
createFireworkAni
()
{
...
...
@@ -395,9 +397,9 @@ cc.Class({
cc
.
find
(
'
Canvas/RibbonNodeBase
'
).
children
,
cc
.
v2
(
600
,
-
400
),
cc
.
v2
(
-
200
,
1000
),
200
,
200
);
setTimeout
(()
=>
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
resolve
(
''
);
},
1000
);
},
1000
)
)
;
});
},
playSFX
(
name
)
{
...
...
@@ -578,14 +580,14 @@ cc.Class({
this
.
playSFX
(
"
mao_choice
"
).
then
(()
=>
{
this
.
catNormal
();
});
setTimeout
(()
=>
{
this
.
_timeoutIds
.
push
(
setTimeout
(()
=>
{
let
items
=
this
.
_cardLayout
.
children
;
let
item
=
items
.
filter
(
it
=>
{
return
it
.
data
.
cardId
==
0
})[
0
];
pg
.
view
.
visible
(
pg
.
view
.
find
(
item
,
'
box
'
),
true
);
this
.
_cantouch
=
true
;
this
.
_successItems
.
push
(
item
);
resolve
(
''
);
},
300
);
},
300
)
)
;
});
},
catFinish
()
{
...
...
@@ -607,5 +609,16 @@ cc.Class({
catNormal
()
{
let
cat
=
pg
.
view
.
find
(
this
,
"
cat
"
);
pg
.
view
.
playDragonBone
(
cat
,
"
normal
"
);
}
},
_timeoutIds
:
null
,
_intervalIds
:
null
,
// 生命周期
onDestroy
()
{
this
.
_timeoutIds
.
forEach
(
id
=>
{
clearTimeout
(
id
);
});
this
.
_intervalIds
.
forEach
(
id
=>
{
clearInterval
(
id
);
});
},
});
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