Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
WL01
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
WL01
Commits
c5b38590
Commit
c5b38590
authored
Jul 18, 2021
by
linzhiguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ 优化启动流程
parent
a4a4bbb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
29 deletions
+18
-29
WL01.fire
play/assets/WL01/scene/WL01.fire
+1
-1
WL01.js
play/assets/WL01/scene/WL01.js
+17
-28
No files found.
play/assets/WL01/scene/WL01.fire
View file @
c5b38590
...
...
@@ -12625,7 +12625,7 @@
"__id__": 230
}
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 233
...
...
play/assets/WL01/scene/WL01.js
View file @
c5b38590
...
...
@@ -162,28 +162,9 @@ cc.Class({
loadEnd
()
{
this
.
initData
();
this
.
initAudio
();
this
.
initView
();
// this.initListener();
},
initData
()
{
},
initAudio
()
{
// const audioNode = cc.find('res/audio');
// const getAudioByResName = (resName) => {
// return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
// }
// this.audioBtn = getAudioByResName('btn');
},
initView
()
{
window
.
WL
=
this
;
this
.
shuffle
(
this
.
data
.
mouses
);
...
...
@@ -193,16 +174,15 @@ cc.Class({
this
.
_hammer
=
cc
.
find
(
'
Canvas/hammer
'
);
this
.
title
.
string
=
this
.
data
.
title
;
if
(
this
.
data
.
audio_url
&&
this
.
data
.
audio_url
!=
""
){
playAudioByUrl
(
this
.
data
.
audio_url
);
let
audio_url
=
this
.
data
.
audio_url
;
if
(
audio_url
&&
audio_url
!=
""
){
playAudioByUrl
(
audio_url
,
()
=>
{
this
.
playGame
();
});
}
else
{
this
.
playGame
();
}
this
.
updateFlagArea
(()
=>
{
this
.
playAudioByName
(
'
time321
'
);
this
.
playTimer
(()
=>
{
this
.
nextMouse
();
})
});
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
event
)
=>
{
if
(
!
this
.
_touched
)
...
...
@@ -240,6 +220,15 @@ cc.Class({
},
this
);
},
playGame
(){
this
.
updateFlagArea
(()
=>
{
this
.
playAudioByName
(
'
time321
'
);
this
.
playTimer
(()
=>
{
this
.
nextMouse
();
})
});
},
updateFlagArea
(
cb
){
let
flag_area
=
cc
.
find
(
'
Canvas/flag_area
'
);
flag_area
.
removeAllChildren
();
...
...
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