Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSAPP2501
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
SSAPP2501
Commits
a9cc2e7d
Commit
a9cc2e7d
authored
Aug 21, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(游戏场景): 添加游戏重启功能及相关UI
parent
db60e65e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
510 additions
and
49 deletions
+510
-49
SSAPP2501.fire
assets/SSAPP2501/scene/SSAPP2501.fire
+437
-46
SSAPP2501.ts
assets/SSAPP2501/scene/SSAPP2501.ts
+73
-3
No files found.
assets/SSAPP2501/scene/SSAPP2501.fire
View file @
a9cc2e7d
...
@@ -94,18 +94,24 @@
...
@@ -94,18 +94,24 @@
},
},
{
{
"__id__": 175
"__id__": 175
},
{
"__id__": 183
},
{
"__id__": 184
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 20
0
"__id__": 20
9
},
},
{
{
"__id__": 2
01
"__id__": 2
10
},
},
{
{
"__id__": 2
02
"__id__": 2
11
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -8609,7 +8615,7 @@
...
@@ -8609,7 +8615,7 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
RabbonBase
",
"_name": "
layout_restart
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
"__id__": 2
...
@@ -8618,12 +8624,388 @@
...
@@ -8618,12 +8624,388 @@
{
{
"__id__": 176
"__id__": 176
},
},
{
"__id__": 180
}
],
"_active": false,
"_components": [
{
"__id__": 182
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "13Au7QMxZHxpdNswpeBGbn"
},
{
"__type__": "cc.Node",
"_name": "gray",
"_objFlags": 0,
"_parent": {
"__id__": 175
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 177
},
{
"__id__": 178
},
{
{
"__id__": 179
"__id__": 179
}
],
"_prefab": null,
"_opacity": 150,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1z3Kwru5AZZy+jrtnK/eE"
},
},
{
{
"__id__": 182
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 176
},
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "48TDR9NDdNTKBDVIczcVxK"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 176
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_id": "d6mN6CsLtLpI8vXvchzqgG"
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 176
},
"_enabled": true,
"_id": "e9hSVu33ZJQYS+dyACV4YA"
},
{
"__type__": "cc.Node",
"_name": "btn_restart",
"_objFlags": 0,
"_parent": {
"__id__": 175
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 181
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 407,
"height": 179
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "4dOvqMRdVO36GB+6dstMcp"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 180
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d7580966-b781-4363-99e0-617bb3bfdd48"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ec0D5DB+NK76QEvHFdXP/0"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 175
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "2blcZv3RJGSbNAnuq2aYwE"
},
{
"__type__": "cc.Node",
"_name": "ani",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e6yLbrZglImrxTuAoAHWfm"
},
{
"__type__": "cc.Node",
"_name": "RabbonBase",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
{
"__id__": 185
"__id__": 185
},
},
...
@@ -8638,6 +9020,15 @@
...
@@ -8638,6 +9020,15 @@
},
},
{
{
"__id__": 197
"__id__": 197
},
{
"__id__": 200
},
{
"__id__": 203
},
{
"__id__": 206
}
}
],
],
"_active": true,
"_active": true,
...
@@ -8695,11 +9086,11 @@
...
@@ -8695,11 +9086,11 @@
"_name": "New Node",
"_name": "New Node",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
75
"__id__": 1
84
},
},
"_children": [
"_children": [
{
{
"__id__": 1
77
"__id__": 1
86
}
}
],
],
"_active": true,
"_active": true,
...
@@ -8757,13 +9148,13 @@
...
@@ -8757,13 +9148,13 @@
"_name": "New Sprite",
"_name": "New Sprite",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
76
"__id__": 1
85
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
78
"__id__": 1
87
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -8819,7 +9210,7 @@
...
@@ -8819,7 +9210,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
77
"__id__": 1
86
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -8851,11 +9242,11 @@
...
@@ -8851,11 +9242,11 @@
"_name": "New Node",
"_name": "New Node",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
75
"__id__": 1
84
},
},
"_children": [
"_children": [
{
{
"__id__": 18
0
"__id__": 18
9
}
}
],
],
"_active": true,
"_active": true,
...
@@ -8913,13 +9304,13 @@
...
@@ -8913,13 +9304,13 @@
"_name": "New Sprite",
"_name": "New Sprite",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
79
"__id__": 1
88
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
81
"__id__": 1
90
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -8975,7 +9366,7 @@
...
@@ -8975,7 +9366,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 18
0
"__id__": 18
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -9007,11 +9398,11 @@
...
@@ -9007,11 +9398,11 @@
"_name": "New Node",
"_name": "New Node",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
75
"__id__": 1
84
},
},
"_children": [
"_children": [
{
{
"__id__": 1
83
"__id__": 1
92
}
}
],
],
"_active": true,
"_active": true,
...
@@ -9069,13 +9460,13 @@
...
@@ -9069,13 +9460,13 @@
"_name": "New Sprite",
"_name": "New Sprite",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
82
"__id__": 1
91
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
84
"__id__": 1
93
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -9131,7 +9522,7 @@
...
@@ -9131,7 +9522,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
83
"__id__": 1
92
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -9163,11 +9554,11 @@
...
@@ -9163,11 +9554,11 @@
"_name": "New Node",
"_name": "New Node",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
75
"__id__": 1
84
},
},
"_children": [
"_children": [
{
{
"__id__": 1
86
"__id__": 1
95
}
}
],
],
"_active": true,
"_active": true,
...
@@ -9225,13 +9616,13 @@
...
@@ -9225,13 +9616,13 @@
"_name": "New Sprite",
"_name": "New Sprite",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
85
"__id__": 1
94
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
87
"__id__": 1
96
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -9287,7 +9678,7 @@
...
@@ -9287,7 +9678,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
86
"__id__": 1
95
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -9319,11 +9710,11 @@
...
@@ -9319,11 +9710,11 @@
"_name": "New Node",
"_name": "New Node",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
75
"__id__": 1
84
},
},
"_children": [
"_children": [
{
{
"__id__": 1
89
"__id__": 1
98
}
}
],
],
"_active": true,
"_active": true,
...
@@ -9381,13 +9772,13 @@
...
@@ -9381,13 +9772,13 @@
"_name": "New Sprite",
"_name": "New Sprite",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
88
"__id__": 1
97
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 19
0
"__id__": 19
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -9443,7 +9834,7 @@
...
@@ -9443,7 +9834,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
89
"__id__": 1
98
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -9475,11 +9866,11 @@
...
@@ -9475,11 +9866,11 @@
"_name": "New Node",
"_name": "New Node",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
75
"__id__": 1
84
},
},
"_children": [
"_children": [
{
{
"__id__":
192
"__id__":
201
}
}
],
],
"_active": true,
"_active": true,
...
@@ -9537,13 +9928,13 @@
...
@@ -9537,13 +9928,13 @@
"_name": "New Sprite",
"_name": "New Sprite",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
191
"__id__":
200
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
193
"__id__":
202
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -9599,7 +9990,7 @@
...
@@ -9599,7 +9990,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
192
"__id__":
201
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -9631,11 +10022,11 @@
...
@@ -9631,11 +10022,11 @@
"_name": "New Node",
"_name": "New Node",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
75
"__id__": 1
84
},
},
"_children": [
"_children": [
{
{
"__id__":
195
"__id__":
204
}
}
],
],
"_active": true,
"_active": true,
...
@@ -9693,13 +10084,13 @@
...
@@ -9693,13 +10084,13 @@
"_name": "New Sprite",
"_name": "New Sprite",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
194
"__id__":
203
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
196
"__id__":
205
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -9755,7 +10146,7 @@
...
@@ -9755,7 +10146,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
195
"__id__":
204
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -9787,11 +10178,11 @@
...
@@ -9787,11 +10178,11 @@
"_name": "New Node",
"_name": "New Node",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
75
"__id__": 1
84
},
},
"_children": [
"_children": [
{
{
"__id__":
198
"__id__":
207
}
}
],
],
"_active": true,
"_active": true,
...
@@ -9849,13 +10240,13 @@
...
@@ -9849,13 +10240,13 @@
"_name": "New Sprite",
"_name": "New Sprite",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
197
"__id__":
206
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
199
"__id__":
208
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -9911,7 +10302,7 @@
...
@@ -9911,7 +10302,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
198
"__id__":
207
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
...
assets/SSAPP2501/scene/SSAPP2501.ts
View file @
a9cc2e7d
...
@@ -104,6 +104,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -104,6 +104,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
initEvent
();
// 初始化事件
this
.
initEvent
();
// 初始化事件
this
.
initGame
();
this
.
initGame
();
}
}
restartGame
()
{
this
.
initData
();
// 初始化数据
this
.
initView
();
// 初始化视图
this
.
initEvent
();
// 初始化事件
this
.
initGame
();
}
/**
/**
* 组件销毁时的回调
* 组件销毁时的回调
* 清理事件监听,防止内存泄漏
* 清理事件监听,防止内存泄漏
...
@@ -176,6 +182,45 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -176,6 +182,45 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
activeFireNodes
=
[];
this
.
activeFireNodes
=
[];
// 初始化触摸状态
// 初始化触摸状态
this
.
touching
=
false
;
this
.
touching
=
false
;
// 初始化录音相关变量
this
.
recordStartTime
=
0
;
this
.
maxRecordDuration
=
30
;
// 初始化提示相关变量
this
.
inactiveTimer
=
0
;
this
.
hintThreshold
=
3
;
this
.
isHintAnimPlaying
=
false
;
// 初始化音频ID
this
.
audioId
=
-
1
;
// 初始化语音动画定时器
this
.
_voiceAniTimer
=
null
;
// 初始化语音关闭状态
this
.
onTouchSpeakCloseClosing
=
false
;
// 初始化重试状态
this
.
tryAgain
=
false
;
this
.
recordTouching
=
false
;
// 初始化重新开始布局
this
.
layout_restart
=
null
;
// 重置游戏布局和页面节点到初始状态
if
(
this
.
layout_game
)
{
// 重置游戏布局位置到初始状态(x=0)
this
.
layout_game
.
x
=
0
;
}
// 重置页面节点状态
if
(
this
.
page_a
)
{
this
.
page_a
.
active
=
true
;
}
if
(
this
.
page_b
)
{
this
.
page_b
.
active
=
false
;
}
}
}
/** 音频播放ID */
/** 音频播放ID */
private
audioId
:
any
;
private
audioId
:
any
;
...
@@ -202,6 +247,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -202,6 +247,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 重置提示动画状态
// 重置提示动画状态
this
.
isHintAnimPlaying
=
false
;
this
.
isHintAnimPlaying
=
false
;
this
.
inactiveTimer
=
0
;
this
.
inactiveTimer
=
0
;
const
currentPage
=
0
;
const
currentPageNode
=
currentPage
%
2
===
0
?
this
.
page_a
:
this
.
page_b
;
const
otherPageNode
=
currentPage
%
2
===
0
?
this
.
page_b
:
this
.
page_a
;
currentPageNode
.
x
=
0
;
otherPageNode
.
x
=
1920
;
}
}
/**
/**
* 初始化事件监听
* 初始化事件监听
...
@@ -344,6 +396,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -344,6 +396,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 使用cc.tween实现layout_game向左移动一页的距离(1920)
// 使用cc.tween实现layout_game向左移动一页的距离(1920)
cc
.
tween
(
this
.
layout_game
)
cc
.
tween
(
this
.
layout_game
)
.
to
(
3.0
,
{
x
:
-
1920
*
currentPage
},
{
easing
:
'
cubicOut
'
})
.
to
(
3.0
,
{
x
:
-
1920
*
currentPage
},
{
easing
:
'
cubicOut
'
})
.
call
(()
=>
{
otherPageNode
.
x
=
1920
*
(
currentPage
+
1
);
})
.
start
();
.
start
();
cc
.
tween
(
this
.
node_firetruck
)
cc
.
tween
(
this
.
node_firetruck
)
.
to
(
3.0
,
{
x
:
-
400
+
1920
*
currentPage
},
{
easing
:
'
cubicOut
'
})
.
to
(
3.0
,
{
x
:
-
400
+
1920
*
currentPage
},
{
easing
:
'
cubicOut
'
})
...
@@ -1245,6 +1300,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -1245,6 +1300,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
onHomeworkFinish
(
data
)
onHomeworkFinish
(
data
)
// 显示重新开始
// 显示重新开始
this
.
showRestart
();
}
private
layout_restart
:
cc
.
Node
=
null
;
showRestart
()
{
if
(
!
this
.
layout_restart
)
this
.
layout_restart
=
cc
.
find
(
'
Canvas/layout_restart
'
);
this
.
layout_restart
.
active
=
true
;
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
.
layout_restart
,
'
btn_restart
'
),
this
.
onTouchRestart
,
this
);
}
hideRestart
()
{
if
(
!
this
.
layout_restart
)
this
.
layout_restart
=
cc
.
find
(
'
Canvas/layout_restart
'
);
this
.
layout_restart
.
active
=
false
;
}
onTouchRestart
()
{
this
.
hideRestart
();
this
.
restartGame
();
}
}
/**
/**
...
...
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