Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy05_pintu
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
hy05_pintu
Commits
90ea4c4f
Commit
90ea4c4f
authored
Jul 09, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5ec68f3c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
15 deletions
+31
-15
layer_back_hy05_pintu.prefab
...hy05_pintu/common/layer_back/layer_back_hy05_pintu.prefab
+2
-2
layer_ending_hy05_pintu.ts
...hy05_pintu/common/layer_ending/layer_ending_hy05_pintu.ts
+3
-1
hy05_pintu.fire
assets/hy05_pintu/scene/hy05_pintu.fire
+2
-2
hy05_pintu.ts
assets/hy05_pintu/scene/hy05_pintu.ts
+24
-10
No files found.
assets/hy05_pintu/common/layer_back/layer_back_hy05_pintu.prefab
View file @
90ea4c4f
...
...
@@ -958,8 +958,8 @@
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags":
1
,
"_left":
0
,
"_alignFlags":
9
,
"_left":
274.52700000000004
,
"_right": 0,
"_top": 67.39999999999998,
"_bottom": 0,
...
...
assets/hy05_pintu/common/layer_ending/layer_ending_hy05_pintu.ts
View file @
90ea4c4f
...
...
@@ -21,7 +21,8 @@ export default class LayerEnding extends cc.Component {
pg
.
view
.
touchOn
(
this
.
replay_btn
,
this
.
onTouchReplay
,
this
)
pg
.
view
.
touchOn
(
this
.
next_btn
,
this
.
onTouchNext
,
this
)
pg
.
event
.
on
(
'
layer_ending_show
'
,
(
data
)
=>
{
this
.
showLayer
(
data
);
// this.showLayer(data);
this
.
onTouchNext
();
})
}
showLayer
(
data
)
{
...
...
@@ -44,6 +45,7 @@ export default class LayerEnding extends cc.Component {
onTouchNext
()
{
pg
.
view
.
visible
(
this
.
layer_center
,
false
)
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
middleLayer
)
return
console
.
log
(
"
middleLayer
"
);
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
const
{
index
,
length
}
=
middleLayerComponent
.
getPageInfo
();
// 返回 length:有多少页; index: 当前第几页(从0开始)
if
(
index
==
length
-
1
)
{
...
...
assets/hy05_pintu/scene/hy05_pintu.fire
View file @
90ea4c4f
...
...
@@ -5999,8 +5999,8 @@
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags":
1
,
"_left":
0
,
"_alignFlags":
9
,
"_left":
274.52700000000004
,
"_right": 0,
"_top": 67.39999999999998,
"_bottom": 0,
...
...
assets/hy05_pintu/scene/hy05_pintu.ts
View file @
90ea4c4f
...
...
@@ -16,7 +16,18 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
addPreloadAudio
()
{
// TODO 根据自己的配置预加载音频资源
this
.
_audioResList
.
push
({
url
:
this
.
data
.
audio_url
});
let
audios
=
[];
function
checkAudio
(
obj
)
{
for
(
let
idx
in
obj
)
{
if
(
typeof
obj
[
idx
]
==
"
object
"
)
{
checkAudio
(
obj
[
idx
]);
}
else
if
(
typeof
obj
[
idx
]
==
"
string
"
)
{
if
(
obj
[
idx
].
indexOf
(
"
.mp3
"
)
>
-
1
&&
obj
[
idx
].
indexOf
(
"
http
"
)
>
-
1
)
audios
.
push
(
obj
[
idx
]);
}
}
}
checkAudio
(
this
.
data
)
this
.
_audioResList
=
audios
;
}
addPreloadAnima
()
{
...
...
@@ -53,11 +64,12 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
@
property
(
cc
.
Node
)
btn_down
:
cc
.
Node
=
null
;
private
coin
:
number
;
initData
()
{
GameJigsaw
.
getIns
().
init
(
this
.
data
);
GameJigsaw
.
getIns
().
reset
();
this
.
cardBgs
=
[];
this
.
coin
=
0
;
}
initView
()
{
...
...
@@ -87,8 +99,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
this
.
replay
();
})
pg
.
event
.
on
(
'
layer_coin_show_coin_end
'
,
()
=>
{
pg
.
event
.
emit
(
'
layer_ending_show
'
,
{
coin
:
3
})
this
.
nextPage
();
})
}
replay
()
{
...
...
@@ -359,16 +370,19 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
if
(
!
over
)
{
pg
.
event
.
emit
(
"
gameOver
"
);
}
else
{
this
.
nextPage
();
pg
.
event
.
once
(
'
layer_right_show_excellent_end
'
,
()
=>
{
this
.
coin
+=
3
;
pg
.
event
.
emit
(
'
layer_coin_show_coin
'
,
this
.
coin
)
//1 2 3硬币数量
})
pg
.
event
.
emit
(
"
layer_right_show_excellent
"
);
}
});
}
gameOver
()
{
pg
.
event
.
once
(
'
layer_right_show_excellent_end
'
,
()
=>
{
pg
.
event
.
emit
(
'
layer_coin_show_coin
'
,
3
)
//1 2 3硬币数量
})
pg
.
event
.
emit
(
"
layer_right_show_excellent
"
);
pg
.
event
.
emit
(
'
layer_ending_show
'
,
{
coin
:
this
.
coin
})
}
...
...
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