Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy17_hds
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
hy17_hds
Commits
5b7a1bd5
Commit
5b7a1bd5
authored
Sep 25, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
监听顺序修改
parent
cd8cf56a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
hy17_hds.ts
assets/hy17_hds/scene/hy17_hds.ts
+5
-7
pg_hy17_hds.ts
assets/hy17_hds/scene/pg_hy17_hds.ts
+3
-2
No files found.
assets/hy17_hds/scene/hy17_hds.ts
View file @
5b7a1bd5
...
...
@@ -29,7 +29,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
initData
();
this
.
initView
();
this
.
initListener
();
pg
.
event
.
on
(
'
npc_voice_play_voice_end
'
,
()
=>
{
pg
.
event
.
on
ce
(
'
npc_voice_play_voice_end
'
,
()
=>
{
this
.
initGame
();
})
pg
.
event
.
emit
(
'
npc_layer_back_init
'
,
this
.
data
)
...
...
@@ -437,17 +437,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
}
gameOver
()
{
this
.
sendData
().
then
(()
=>
{
this
.
sendData
().
then
(()
=>
{
})
pg
.
event
.
clear
();
this
.
scheduleOnce
(()
=>
{
pg
.
view
.
visible
(
this
.
sentence_box
,
false
)
// pg.event.emit('layer_ending_show', {
// coin: this.score
// })
// 下一页
pg
.
event
.
clear
();
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
).
getComponent
(
'
middleLayer
'
);
middleLayer
.
saveGolds
(
this
.
score
);
// 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer
.
goNextPage
();
// 跳转到下一页
})
}
,
0.5
)
}
}
...
...
assets/hy17_hds/scene/pg_hy17_hds.ts
View file @
5b7a1bd5
...
...
@@ -16,7 +16,8 @@ class Emitter {
clear
()
{
this
.
_callbacks
=
{};
}
on
(
event
,
fn
)
{
on
(
event
,
fn
:
any
)
{
this
.
off
(
event
);
if
(
!
this
.
_callbacks
[
event
])
this
.
_callbacks
[
event
]
=
[];
this
.
_callbacks
[
event
].
push
(
fn
);
};
...
...
@@ -28,7 +29,7 @@ class Emitter {
on
.
fn
=
fn
;
this
.
on
(
event
,
on
);
};
off
(
event
,
fn
)
{
off
(
event
,
fn
?:
any
)
{
// all
if
(
0
==
arguments
.
length
)
{
this
.
_callbacks
=
{};
...
...
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