Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cake
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
cake
Commits
c349b15f
Commit
c349b15f
authored
Mar 15, 2022
by
李帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化完成
parent
05f8ab0c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1016 additions
and
2338 deletions
+1016
-2338
cake.meta
assets/cake.meta
+3
-3
cake.fire
assets/cake/scene/cake.fire
+432
-298
cake.ts
assets/cake/scene/cake.ts
+227
-154
cocos_generator.fire
assets/cake/scene/cocos_generator.fire
+0
-1303
cocos_generator.fire.meta
assets/cake/scene/cocos_generator.fire.meta
+0
-7
cocos_generator.ts
assets/cake/scene/cocos_generator.ts
+0
-195
cocos_generator.ts.meta
assets/cake/scene/cocos_generator.ts.meta
+0
-9
test_nice_try.png.meta
assets/cake/textures/切图/test_nice_try.png.meta
+2
-2
buildCocos.js
bin/buildCocos.js
+352
-367
No files found.
assets/cake.meta
View file @
c349b15f
{
{
"ver": "1.1.2",
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle":
tru
e,
"isBundle":
fals
e,
"bundleName": "",
"bundleName": "",
"priority": 1,
"priority": 1,
"compressionType": {},
"compressionType": {},
"optimizeHotUpdate": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"isRemoteBundle": {
"ios":
tru
e,
"ios":
fals
e,
"android":
tru
e
"android":
fals
e
},
},
"subMetas": {}
"subMetas": {}
}
}
\ No newline at end of file
assets/cake/scene/cake.fire
View file @
c349b15f
...
@@ -87,25 +87,22 @@
...
@@ -87,25 +87,22 @@
"__id__": 15
"__id__": 15
},
},
{
{
"__id__": 38
"__id__": 36
},
{
"__id__": 87
},
},
{
{
"__id__":
94
"__id__":
89
},
},
{
{
"__id__":
107
"__id__":
96
},
},
{
{
"__id__": 109
"__id__": 109
},
},
{
{
"__id__": 1
20
"__id__": 1
11
},
},
{
{
"__id__": 12
3
"__id__": 12
2
},
},
{
{
"__id__": 125
"__id__": 125
...
@@ -121,18 +118,21 @@
...
@@ -121,18 +118,21 @@
},
},
{
{
"__id__": 133
"__id__": 133
},
{
"__id__": 135
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
59
"__id__": 1
61
},
},
{
{
"__id__": 16
0
"__id__": 16
2
},
},
{
{
"__id__": 16
1
"__id__": 16
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -781,10 +781,7 @@
...
@@ -781,10 +781,7 @@
"__id__": 16
"__id__": 16
},
},
{
{
"__id__": 18
"__id__": 26
},
{
"__id__": 28
}
}
],
],
"_active": true,
"_active": true,
...
@@ -837,108 +834,6 @@
...
@@ -837,108 +834,6 @@
"groupIndex": 0,
"groupIndex": 0,
"_id": "949VRTf5ZN1KxKdKJ8Yzru"
"_id": "949VRTf5ZN1KxKdKJ8Yzru"
},
},
{
"__type__": "cc.Node",
"_name": "cake_drop_down",
"_objFlags": 0,
"_parent": {
"__id__": 15
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 194.01,
"height": 88
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-640,
200,
0,
0,
0,
0,
1,
1,
1,
1.25
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "f4oaqMpVJE1LGucSxbLhcN"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "newAnimation",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "eb20f6cb-741a-4ee7-b58a-9675a749ab7e#c990989f-66e0-4d66-9ffc-e7ccdb3a82a1",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "eb20f6cb-741a-4ee7-b58a-9675a749ab7e"
},
"_N$dragonAtlasAsset": {
"__uuid__": "c990989f-66e0-4d66-9ffc-e7ccdb3a82a1"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "18y8GtWWtOfZlLldtWXD0Y"
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "cake_select_01",
"_name": "cake_select_01",
...
@@ -948,22 +843,22 @@
...
@@ -948,22 +843,22 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 1
9
"__id__": 1
7
},
},
{
{
"__id__":
21
"__id__":
19
},
},
{
{
"__id__": 2
4
"__id__": 2
2
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 2
6
"__id__": 2
4
},
},
{
{
"__id__": 2
7
"__id__": 2
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1019,13 +914,13 @@
...
@@ -1019,13 +914,13 @@
"_name": "side",
"_name": "side",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
8
"__id__": 1
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__":
20
"__id__":
18
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1081,7 +976,7 @@
...
@@ -1081,7 +976,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
9
"__id__": 1
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1113,16 +1008,16 @@
...
@@ -1113,16 +1008,16 @@
"_name": "label",
"_name": "label",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
8
"__id__": 1
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 2
2
"__id__": 2
0
},
},
{
{
"__id__": 2
3
"__id__": 2
1
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1178,7 +1073,7 @@
...
@@ -1178,7 +1073,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
21
"__id__":
19
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1211,7 +1106,7 @@
...
@@ -1211,7 +1106,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
21
"__id__":
19
},
},
"_enabled": true,
"_enabled": true,
"_color": {
"_color": {
...
@@ -1229,13 +1124,13 @@
...
@@ -1229,13 +1124,13 @@
"_name": "cake_drop_down",
"_name": "cake_drop_down",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
8
"__id__": 1
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 2
5
"__id__": 2
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1291,7 +1186,7 @@
...
@@ -1291,7 +1186,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
4
"__id__": 2
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1331,7 +1226,7 @@
...
@@ -1331,7 +1226,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
8
"__id__": 1
6
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1363,7 +1258,7 @@
...
@@ -1363,7 +1258,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
8
"__id__": 1
6
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -1435,22 +1330,22 @@
...
@@ -1435,22 +1330,22 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 2
9
"__id__": 2
7
},
},
{
{
"__id__":
31
"__id__":
29
},
},
{
{
"__id__": 3
4
"__id__": 3
2
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 3
6
"__id__": 3
4
},
},
{
{
"__id__": 3
7
"__id__": 3
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1506,13 +1401,13 @@
...
@@ -1506,13 +1401,13 @@
"_name": "side",
"_name": "side",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
8
"__id__": 2
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__":
30
"__id__":
28
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1568,7 +1463,7 @@
...
@@ -1568,7 +1463,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
9
"__id__": 2
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1600,16 +1495,16 @@
...
@@ -1600,16 +1495,16 @@
"_name": "label",
"_name": "label",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
8
"__id__": 2
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
2
"__id__": 3
0
},
},
{
{
"__id__": 3
3
"__id__": 3
1
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1665,7 +1560,7 @@
...
@@ -1665,7 +1560,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
31
"__id__":
29
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1700,7 +1595,7 @@
...
@@ -1700,7 +1595,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
31
"__id__":
29
},
},
"_enabled": true,
"_enabled": true,
"_color": {
"_color": {
...
@@ -1718,13 +1613,13 @@
...
@@ -1718,13 +1613,13 @@
"_name": "cake_drop_down",
"_name": "cake_drop_down",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
8
"__id__": 2
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 3
5
"__id__": 3
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1780,7 +1675,7 @@
...
@@ -1780,7 +1675,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
4
"__id__": 3
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1820,7 +1715,7 @@
...
@@ -1820,7 +1715,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
8
"__id__": 2
6
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1852,7 +1747,7 @@
...
@@ -1852,7 +1747,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
8
"__id__": 2
6
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -1924,10 +1819,10 @@
...
@@ -1924,10 +1819,10 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 3
9
"__id__": 3
7
},
},
{
{
"__id__":
41
"__id__":
39
},
},
{
{
"__id__": 82
"__id__": 82
...
@@ -1988,13 +1883,13 @@
...
@@ -1988,13 +1883,13 @@
"_name": "desktop",
"_name": "desktop",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 3
8
"__id__": 3
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
40
"__id__":
38
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2050,7 +1945,7 @@
...
@@ -2050,7 +1945,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
9
"__id__": 3
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2082,9 +1977,12 @@
...
@@ -2082,9 +1977,12 @@
"_name": "cake",
"_name": "cake",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 3
8
"__id__": 3
6
},
},
"_children": [
"_children": [
{
"__id__": 40
},
{
{
"__id__": 42
"__id__": 42
},
},
...
@@ -2154,12 +2052,114 @@
...
@@ -2154,12 +2052,114 @@
"groupIndex": 0,
"groupIndex": 0,
"_id": "49XmekaW1Ei7T8Owod6JBy"
"_id": "49XmekaW1Ei7T8Owod6JBy"
},
},
{
"__type__": "cc.Node",
"_name": "cake_drop_down",
"_objFlags": 0,
"_parent": {
"__id__": 39
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 41
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 194.01,
"height": 88
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
620,
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": "76w5ypIdNFiaOvuusCrQ3F"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 40
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "newAnimation",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": 1,
"premultipliedAlpha": false,
"_armatureKey": "eb20f6cb-741a-4ee7-b58a-9675a749ab7e#c990989f-66e0-4d66-9ffc-e7ccdb3a82a1",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "eb20f6cb-741a-4ee7-b58a-9675a749ab7e"
},
"_N$dragonAtlasAsset": {
"__uuid__": "c990989f-66e0-4d66-9ffc-e7ccdb3a82a1"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "c2Zfnz5KVE27M5tDkmJjBX"
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "cake_base",
"_name": "cake_base",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
41
"__id__":
39
},
},
"_children": [
"_children": [
{
{
...
@@ -2261,7 +2261,7 @@
...
@@ -2261,7 +2261,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
0
,
3
,
0,
0,
0,
0,
0,
0,
...
@@ -2375,7 +2375,7 @@
...
@@ -2375,7 +2375,7 @@
"_name": "cake_style_05",
"_name": "cake_style_05",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
41
"__id__":
39
},
},
"_children": [
"_children": [
{
{
...
@@ -2574,7 +2574,7 @@
...
@@ -2574,7 +2574,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
0
,
3
,
0,
0,
0,
0,
0,
0,
...
@@ -2688,7 +2688,7 @@
...
@@ -2688,7 +2688,7 @@
"_name": "cake_style_04",
"_name": "cake_style_04",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
41
"__id__":
39
},
},
"_children": [
"_children": [
{
{
...
@@ -2887,7 +2887,7 @@
...
@@ -2887,7 +2887,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
0
,
3
,
0,
0,
0,
0,
0,
0,
...
@@ -3001,7 +3001,7 @@
...
@@ -3001,7 +3001,7 @@
"_name": "cake_style_03",
"_name": "cake_style_03",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
41
"__id__":
39
},
},
"_children": [
"_children": [
{
{
...
@@ -3200,7 +3200,7 @@
...
@@ -3200,7 +3200,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
0
,
3
,
0,
0,
0,
0,
0,
0,
...
@@ -3314,7 +3314,7 @@
...
@@ -3314,7 +3314,7 @@
"_name": "cake_style_02",
"_name": "cake_style_02",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
41
"__id__":
39
},
},
"_children": [
"_children": [
{
{
...
@@ -3513,7 +3513,7 @@
...
@@ -3513,7 +3513,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
0
,
3
,
0,
0,
0,
0,
0,
0,
...
@@ -3627,7 +3627,7 @@
...
@@ -3627,7 +3627,7 @@
"_name": "cake_style_01",
"_name": "cake_style_01",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
41
"__id__":
39
},
},
"_children": [
"_children": [
{
{
...
@@ -3826,7 +3826,7 @@
...
@@ -3826,7 +3826,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
0
,
3
,
0,
0,
0,
0,
0,
0,
...
@@ -3940,7 +3940,7 @@
...
@@ -3940,7 +3940,7 @@
"_name": "pc",
"_name": "pc",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 3
8
"__id__": 3
6
},
},
"_children": [
"_children": [
{
{
...
@@ -4101,11 +4101,77 @@
...
@@ -4101,11 +4101,77 @@
"_parent": {
"_parent": {
"__id__": 82
"__id__": 82
},
},
"_children": [],
"_children": [
{
"__id__": 86
}
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 86
"__id__": 88
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 789,
"height": 492
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
345,
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": "6dTLynhYZO+aX8+jBftAUg"
},
{
"__type__": "cc.Node",
"_name": "btn_replay",
"_objFlags": 0,
"_parent": {
"__id__": 85
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 87
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4119,8 +4185,8 @@
...
@@ -4119,8 +4185,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
789
,
"width":
1280
,
"height":
492
"height":
720
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -4132,14 +4198,14 @@
...
@@ -4132,14 +4198,14 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
345
,
0
,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1
,
2
,
1
,
2
,
1
1
]
]
},
},
...
@@ -4154,7 +4220,75 @@
...
@@ -4154,7 +4220,75 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "6dTLynhYZO+aX8+jBftAUg"
"_id": "46MpVRk+dJua8Stgsq20jU"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 86
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "e32CgTc1dBFaQ36V8skly1"
},
},
{
{
"__type__": "cc.Sprite",
"__type__": "cc.Sprite",
...
@@ -4197,7 +4331,7 @@
...
@@ -4197,7 +4331,7 @@
},
},
"_children": [
"_children": [
{
{
"__id__":
88
"__id__":
90
}
}
],
],
"_active": true,
"_active": true,
...
@@ -4255,20 +4389,20 @@
...
@@ -4255,20 +4389,20 @@
"_name": "candle",
"_name": "candle",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 8
7
"__id__": 8
9
},
},
"_children": [
"_children": [
{
{
"__id__":
89
"__id__":
91
},
},
{
{
"__id__": 9
1
"__id__": 9
3
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 9
3
"__id__": 9
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4324,13 +4458,13 @@
...
@@ -4324,13 +4458,13 @@
"_name": "cake_timeout_ske",
"_name": "cake_timeout_ske",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
88
"__id__":
90
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 9
0
"__id__": 9
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4386,7 +4520,7 @@
...
@@ -4386,7 +4520,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
89
"__id__":
91
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4426,13 +4560,13 @@
...
@@ -4426,13 +4560,13 @@
"_name": "cake_fire_ske",
"_name": "cake_fire_ske",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
88
"__id__":
90
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 9
2
"__id__": 9
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4488,7 +4622,7 @@
...
@@ -4488,7 +4622,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
1
"__id__": 9
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4528,7 +4662,7 @@
...
@@ -4528,7 +4662,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
88
"__id__":
90
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4564,13 +4698,13 @@
...
@@ -4564,13 +4698,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 9
5
"__id__": 9
7
},
},
{
{
"__id__":
98
"__id__":
100
},
},
{
{
"__id__": 10
5
"__id__": 10
7
}
}
],
],
"_active": true,
"_active": true,
...
@@ -4628,16 +4762,16 @@
...
@@ -4628,16 +4762,16 @@
"_name": "btn_submit",
"_name": "btn_submit",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
4
"__id__": 9
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 9
6
"__id__": 9
8
},
},
{
{
"__id__": 9
7
"__id__": 9
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4693,7 +4827,7 @@
...
@@ -4693,7 +4827,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
5
"__id__": 9
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4725,7 +4859,7 @@
...
@@ -4725,7 +4859,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
5
"__id__": 9
7
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -4793,23 +4927,23 @@
...
@@ -4793,23 +4927,23 @@
"_name": "btn_sound",
"_name": "btn_sound",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
4
"__id__": 9
6
},
},
"_children": [
"_children": [
{
{
"__id__":
99
"__id__":
101
},
},
{
{
"__id__": 10
1
"__id__": 10
3
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 10
3
"__id__": 10
5
},
},
{
{
"__id__": 10
4
"__id__": 10
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4865,13 +4999,13 @@
...
@@ -4865,13 +4999,13 @@
"_name": "close",
"_name": "close",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
98
"__id__":
100
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
0
"__id__": 10
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4927,7 +5061,7 @@
...
@@ -4927,7 +5061,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
99
"__id__":
101
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4959,13 +5093,13 @@
...
@@ -4959,13 +5093,13 @@
"_name": "open",
"_name": "open",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
98
"__id__":
100
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
2
"__id__": 10
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5021,7 +5155,7 @@
...
@@ -5021,7 +5155,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
1
"__id__": 10
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5053,7 +5187,7 @@
...
@@ -5053,7 +5187,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
98
"__id__":
100
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5085,7 +5219,7 @@
...
@@ -5085,7 +5219,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
98
"__id__":
100
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -5153,13 +5287,13 @@
...
@@ -5153,13 +5287,13 @@
"_name": "offscum",
"_name": "offscum",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
4
"__id__": 9
6
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 10
6
"__id__": 10
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5215,7 +5349,7 @@
...
@@ -5215,7 +5349,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
5
"__id__": 10
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5253,7 +5387,7 @@
...
@@ -5253,7 +5387,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 1
08
"__id__": 1
10
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5309,7 +5443,7 @@
...
@@ -5309,7 +5443,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
7
"__id__": 10
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5345,10 +5479,10 @@
...
@@ -5345,10 +5479,10 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 11
0
"__id__": 11
2
},
},
{
{
"__id__": 11
2
"__id__": 11
4
}
}
],
],
"_active": true,
"_active": true,
...
@@ -5406,13 +5540,13 @@
...
@@ -5406,13 +5540,13 @@
"_name": "layout",
"_name": "layout",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
09
"__id__": 1
11
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 11
1
"__id__": 11
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5468,7 +5602,7 @@
...
@@ -5468,7 +5602,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
0
"__id__": 11
2
},
},
"_enabled": true,
"_enabled": true,
"_layoutSize": {
"_layoutSize": {
...
@@ -5500,23 +5634,23 @@
...
@@ -5500,23 +5634,23 @@
"_name": "item",
"_name": "item",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
09
"__id__": 1
11
},
},
"_children": [
"_children": [
{
"__id__": 113
},
{
{
"__id__": 115
"__id__": 115
},
},
{
{
"__id__": 117
"__id__": 117
},
{
"__id__": 119
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 1
19
"__id__": 1
21
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5572,13 +5706,13 @@
...
@@ -5572,13 +5706,13 @@
"_name": "bule",
"_name": "bule",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 11
2
"__id__": 11
4
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 11
4
"__id__": 11
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5634,7 +5768,7 @@
...
@@ -5634,7 +5768,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
3
"__id__": 11
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5666,13 +5800,13 @@
...
@@ -5666,13 +5800,13 @@
"_name": "red",
"_name": "red",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 11
2
"__id__": 11
4
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 11
6
"__id__": 11
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5728,7 +5862,7 @@
...
@@ -5728,7 +5862,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
5
"__id__": 11
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5760,13 +5894,13 @@
...
@@ -5760,13 +5894,13 @@
"_name": "tag",
"_name": "tag",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 11
2
"__id__": 11
4
},
},
"_children": [],
"_children": [],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 1
18
"__id__": 1
20
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5822,7 +5956,7 @@
...
@@ -5822,7 +5956,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
7
"__id__": 11
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5854,7 +5988,7 @@
...
@@ -5854,7 +5988,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 11
2
"__id__": 11
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5892,10 +6026,10 @@
...
@@ -5892,10 +6026,10 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 12
1
"__id__": 12
3
},
},
{
{
"__id__": 12
2
"__id__": 12
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -5951,7 +6085,7 @@
...
@@ -5951,7 +6085,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
0
"__id__": 12
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -5983,7 +6117,7 @@
...
@@ -5983,7 +6117,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
0
"__id__": 12
2
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -6057,7 +6191,7 @@
...
@@ -6057,7 +6191,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 12
4
"__id__": 12
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6113,7 +6247,7 @@
...
@@ -6113,7 +6247,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
3
"__id__": 12
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6159,7 +6293,7 @@
...
@@ -6159,7 +6293,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 12
6
"__id__": 12
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6215,7 +6349,7 @@
...
@@ -6215,7 +6349,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
5
"__id__": 12
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6223,7 +6357,7 @@
...
@@ -6223,7 +6357,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
}
],
],
"_srcBlendFactor":
770
,
"_srcBlendFactor":
1
,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_spriteFrame": {
"_spriteFrame": {
"__uuid__": "8658bd9b-be18-4632-90b8-76427a1c1d35"
"__uuid__": "8658bd9b-be18-4632-90b8-76427a1c1d35"
...
@@ -6253,7 +6387,7 @@
...
@@ -6253,7 +6387,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 1
28
"__id__": 1
30
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6309,7 +6443,7 @@
...
@@ -6309,7 +6443,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 12
7
"__id__": 12
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6347,7 +6481,7 @@
...
@@ -6347,7 +6481,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 13
0
"__id__": 13
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6403,7 +6537,7 @@
...
@@ -6403,7 +6537,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
29
"__id__": 1
31
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6441,7 +6575,7 @@
...
@@ -6441,7 +6575,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 13
2
"__id__": 13
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6497,7 +6631,7 @@
...
@@ -6497,7 +6631,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
1
"__id__": 13
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -6541,13 +6675,13 @@
...
@@ -6541,13 +6675,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 13
4
"__id__": 13
6
},
},
{
{
"__id__": 13
7
"__id__": 13
9
},
},
{
{
"__id__": 14
2
"__id__": 14
4
}
}
],
],
"_active": false,
"_active": false,
...
@@ -6605,11 +6739,11 @@
...
@@ -6605,11 +6739,11 @@
"_name": "font",
"_name": "font",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 13
3
"__id__": 13
5
},
},
"_children": [
"_children": [
{
{
"__id__": 13
5
"__id__": 13
7
}
}
],
],
"_active": true,
"_active": true,
...
@@ -6667,13 +6801,13 @@
...
@@ -6667,13 +6801,13 @@
"_name": "BRLNSDB",
"_name": "BRLNSDB",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 13
4
"__id__": 13
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 13
6
"__id__": 13
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6729,7 +6863,7 @@
...
@@ -6729,7 +6863,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 13
5
"__id__": 13
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [],
...
@@ -6760,14 +6894,14 @@
...
@@ -6760,14 +6894,14 @@
"_name": "img",
"_name": "img",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 13
3
"__id__": 13
5
},
},
"_children": [
"_children": [
{
{
"__id__": 1
38
"__id__": 1
40
},
},
{
{
"__id__": 14
0
"__id__": 14
2
}
}
],
],
"_active": true,
"_active": true,
...
@@ -6825,13 +6959,13 @@
...
@@ -6825,13 +6959,13 @@
"_name": "candle_select",
"_name": "candle_select",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 13
7
"__id__": 13
9
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
39
"__id__": 1
41
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6887,7 +7021,7 @@
...
@@ -6887,7 +7021,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
38
"__id__": 1
40
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [],
...
@@ -6915,13 +7049,13 @@
...
@@ -6915,13 +7049,13 @@
"_name": "candle_test",
"_name": "candle_test",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 13
7
"__id__": 13
9
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 14
1
"__id__": 14
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -6977,7 +7111,7 @@
...
@@ -6977,7 +7111,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
0
"__id__": 14
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [],
...
@@ -7005,12 +7139,9 @@
...
@@ -7005,12 +7139,9 @@
"_name": "audio",
"_name": "audio",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 13
3
"__id__": 13
5
},
},
"_children": [
"_children": [
{
"__id__": 143
},
{
{
"__id__": 145
"__id__": 145
},
},
...
@@ -7031,6 +7162,9 @@
...
@@ -7031,6 +7162,9 @@
},
},
{
{
"__id__": 157
"__id__": 157
},
{
"__id__": 159
}
}
],
],
"_active": true,
"_active": true,
...
@@ -7088,13 +7222,13 @@
...
@@ -7088,13 +7222,13 @@
"_name": "enter",
"_name": "enter",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 14
4
"__id__": 14
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -7150,7 +7284,7 @@
...
@@ -7150,7 +7284,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
3
"__id__": 14
5
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -7169,13 +7303,13 @@
...
@@ -7169,13 +7303,13 @@
"_name": "right",
"_name": "right",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 14
6
"__id__": 14
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -7231,7 +7365,7 @@
...
@@ -7231,7 +7365,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
5
"__id__": 14
7
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -7250,13 +7384,13 @@
...
@@ -7250,13 +7384,13 @@
"_name": "voice_test_nice_try",
"_name": "voice_test_nice_try",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
48
"__id__": 1
50
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -7312,7 +7446,7 @@
...
@@ -7312,7 +7446,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 14
7
"__id__": 14
9
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -7331,13 +7465,13 @@
...
@@ -7331,13 +7465,13 @@
"_name": "voice_test_excellent",
"_name": "voice_test_excellent",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 15
0
"__id__": 15
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -7393,7 +7527,7 @@
...
@@ -7393,7 +7527,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
49
"__id__": 1
51
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -7412,13 +7546,13 @@
...
@@ -7412,13 +7546,13 @@
"_name": "error",
"_name": "error",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 15
2
"__id__": 15
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -7474,7 +7608,7 @@
...
@@ -7474,7 +7608,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 15
1
"__id__": 15
3
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -7493,13 +7627,13 @@
...
@@ -7493,13 +7627,13 @@
"_name": "game_over_came_on",
"_name": "game_over_came_on",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 15
4
"__id__": 15
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -7555,7 +7689,7 @@
...
@@ -7555,7 +7689,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 15
3
"__id__": 15
5
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -7574,13 +7708,13 @@
...
@@ -7574,13 +7708,13 @@
"_name": "game_over_nice_try",
"_name": "game_over_nice_try",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 15
6
"__id__": 15
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -7636,7 +7770,7 @@
...
@@ -7636,7 +7770,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 15
5
"__id__": 15
7
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -7655,13 +7789,13 @@
...
@@ -7655,13 +7789,13 @@
"_name": "all_right",
"_name": "all_right",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
2
"__id__": 14
4
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
58
"__id__": 1
60
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -7717,7 +7851,7 @@
...
@@ -7717,7 +7851,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 15
7
"__id__": 15
9
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
...
assets/cake/scene/cake.ts
View file @
c349b15f
/*
/*
* @Author: ls
* @Author: ls
* @Date: 2022-03-09 21:15:44
* @Date: 2022-03-09 21:15:44
* @LastEditTime: 2022-03-15 1
1:50:32
* @LastEditTime: 2022-03-15 1
7:46:21
* @LastEditors: ls
* @LastEditors: ls
* @Description: 蛋糕
* @Description: 蛋糕
* @FilePath: \cake\assets\cake\scene\cake.ts
* @FilePath: \cake\assets\cake\scene\cake.ts
...
@@ -47,6 +47,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -47,6 +47,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
_results
=
null
;
// 题目结果
_results
=
null
;
// 题目结果
_sounding
=
null
;
// 播放题干中
_sounding
=
null
;
// 播放题干中
_replaying
=
null
;
// 评测动画播放中
_schedule_candle
=
null
;
// 蜡烛燃烧回调
_schedule_candle
=
null
;
// 蜡烛燃烧回调
_timeout
=
null
;
// 倒计时
_timeout
=
null
;
// 倒计时
...
@@ -56,6 +58,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -56,6 +58,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
_curPage
=
0
;
this
.
_curPage
=
0
;
this
.
_results
=
[];
this
.
_results
=
[];
this
.
_sounding
=
false
;
this
.
_sounding
=
false
;
this
.
_replaying
=
false
;
this
.
_schedule_candle
=
null
;
this
.
_schedule_candle
=
null
;
this
.
_timeout
=
0
;
this
.
_timeout
=
0
;
...
@@ -178,8 +181,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -178,8 +181,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
// 隐藏选项
// 隐藏选项
let
cake_drop_down
=
cc
.
find
(
'
right/cake_drop_down
'
,
this
.
node
);
cake_drop_down
.
active
=
false
;
let
cake_select_01
=
cc
.
find
(
'
right/cake_select_01
'
,
this
.
node
);
let
cake_select_01
=
cc
.
find
(
'
right/cake_select_01
'
,
this
.
node
);
cake_select_01
.
active
=
false
;
cake_select_01
.
active
=
false
;
let
cake_select_02
=
cc
.
find
(
'
right/cake_select_02
'
,
this
.
node
);
let
cake_select_02
=
cc
.
find
(
'
right/cake_select_02
'
,
this
.
node
);
...
@@ -275,12 +276,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -275,12 +276,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 蛋糕底座显示完整单词
// 蛋糕底座显示完整单词
let
cake_base
=
cake
.
getChildByName
(
'
cake_base
'
);
let
cake_base
=
cake
.
getChildByName
(
'
cake_base
'
);
cake_base
.
active
=
true
;
cake_base
.
active
=
true
;
cake
.
getChildByName
(
'
cake_drop_down
'
).
active
=
false
;
cake_base
.
getChildByName
(
'
label
'
).
getComponent
(
cc
.
Label
).
string
=
problem
.
text
;
cake_base
.
getChildByName
(
'
label
'
).
getComponent
(
cc
.
Label
).
string
=
problem
.
text
;
// 根据单词长度显示蛋糕
// 根据单词长度显示蛋糕
for
(
let
index
=
0
;
index
<
problem
.
text
.
length
-
1
;
index
++
)
{
for
(
let
index
=
0
;
index
<
problem
.
text
.
length
-
1
;
index
++
)
{
let
show_cake
=
cake
.
getChildByName
(
`cake_style_0
${
index
+
1
}
`
);
let
show_cake
=
cake
.
getChildByName
(
`cake_style_0
${
index
+
1
}
`
);
show_cake
.
active
=
true
;
show_cake
.
active
=
true
;
show_cake
.
getChildByName
(
'
label
'
).
getComponent
(
cc
.
Label
).
string
=
problem
.
text
[
index
];
show_cake
.
getChildByName
(
'
label
'
).
getComponent
(
cc
.
Label
).
string
=
problem
.
text
[
index
];
show_cake
.
getChildByName
(
'
side
'
).
active
=
false
;
}
}
// 移入选项蛋糕
// 移入选项蛋糕
...
@@ -290,6 +293,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -290,6 +293,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
Tween
.
stopAllByTarget
(
cake_select_02
);
cc
.
Tween
.
stopAllByTarget
(
cake_select_02
);
cake_select_01
.
x
=
200
;
cake_select_01
.
x
=
200
;
cake_select_02
.
x
=
200
;
cake_select_02
.
x
=
200
;
cake_select_01
.
y
=
100
;
cake_select_02
.
y
=
-
100
;
cake_select_01
.
active
=
true
;
cake_select_01
.
active
=
true
;
cake_select_02
.
active
=
true
;
cake_select_02
.
active
=
true
;
cc
.
tween
(
cake_select_01
).
to
(
0.5
,
{
x
:
-
200
}).
start
();
cc
.
tween
(
cake_select_01
).
to
(
0.5
,
{
x
:
-
200
}).
start
();
...
@@ -430,12 +435,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -430,12 +435,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
tween
(
cake_select_right
)
cc
.
tween
(
cake_select_right
)
.
to
(
0.5
,
{
position
:
cc
.
v3
(
tarRightPos
),
scale
:
cake_style
.
scale
})
.
to
(
0.5
,
{
position
:
cc
.
v3
(
tarRightPos
),
scale
:
cake_style
.
scale
})
.
call
(()
=>
{
.
call
(()
=>
{
// let cake_drop_down = cake_select_right.getChildByName('cake_drop_down');
cake_select_right
.
active
=
false
;
// cake_drop_down.x = 0;
cake_select_right
.
scale
=
0.8
;
// cake_drop_down.y = cake_style.scale * 50;
cake_select_right
.
getChildByName
(
'
side
'
).
active
=
false
;
let
cake_drop_down
=
cc
.
find
(
'
right/cake_drop_down
'
,
self
.
node
);
cake_drop_down
.
x
=
tarRightPos
.
x
;
cake_style
.
active
=
true
;
cake_drop_down
.
y
=
tarRightPos
.
y
+
cake_style
.
scale
*
50
;
cake_style
.
getChildByName
(
'
label
'
).
getComponent
(
cc
.
Label
).
string
=
problem
.
rightLetter
;
cake_style
.
getChildByName
(
'
side
'
).
active
=
true
;
let
cake_drop_down
=
cake
.
getChildByName
(
'
cake_drop_down
'
);
cake_drop_down
.
y
=
tarNodePos
.
y
+
50
*
cake_style
.
scale
;
cake_drop_down
.
active
=
true
;
cake_drop_down
.
active
=
true
;
let
dragonBones_cake_drop_down
=
cake_drop_down
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
let
dragonBones_cake_drop_down
=
cake_drop_down
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonBones_cake_drop_down
.
playAnimation
(
'
newAnimation
'
,
1
);
dragonBones_cake_drop_down
.
playAnimation
(
'
newAnimation
'
,
1
);
...
@@ -447,7 +455,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -447,7 +455,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 移除错误选项点击事件
// 移除错误选项点击事件
cake_select_wrong
.
off
(
'
click
'
);
cake_select_wrong
.
off
(
'
click
'
);
//
隐藏
干扰选项蛋糕
//
移出
干扰选项蛋糕
// cake_select_wrong.x = -200;
// cake_select_wrong.x = -200;
cake_select_wrong
.
active
=
true
;
cake_select_wrong
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
cake_select_wrong
);
cc
.
Tween
.
stopAllByTarget
(
cake_select_wrong
);
...
@@ -475,128 +483,138 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -475,128 +483,138 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
initGame
();
this
.
initGame
();
}
}
startTest
()
{
startTest
(
value
)
{
// TODO 结束录音
// 开始系统评测
// TODO 开始测评
window
[
'
courseware
'
].
startTest
(
value
);
// window['courseware'].startTest();
}
this
.
stopTest
();
// 渐显遮罩
let
mask
=
cc
.
find
(
'
mask
'
,
this
.
node
);
mask
.
opacity
=
0
;
mask
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
mask
);
cc
.
tween
(
mask
).
to
(
0.5
,
{
opacity
:
255
}).
start
();
// TODO 文档未体现 移除蜡烛和提交
stopTest
()
{
// 移出提交
// 结束系统评测
let
submit
=
cc
.
find
(
'
right_down/btn_submit
'
,
this
.
node
);
window
[
'
courseware
'
].
stopTest
((
res
)
=>
{
submit
.
off
(
'
click
'
);
// 模拟数据
// submit.x = -120;
// let res = '{"result":{"overall":100}}';
submit
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
submit
);
let
replay
=
cc
.
find
(
'
down/pc/frame/btn_replay
'
,
this
.
node
);
cc
.
tween
(
submit
)
replay
.
off
(
'
click
'
);
.
to
(
0.5
,
{
x
:
120
})
replay
.
active
=
false
;
.
call
(()
=>
{
submit
.
active
=
false
;
// 渐显遮罩
})
let
mask
=
cc
.
find
(
'
mask
'
,
this
.
node
);
.
start
();
mask
.
opacity
=
0
;
mask
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
mask
);
cc
.
tween
(
mask
).
to
(
0.5
,
{
opacity
:
255
}).
start
();
// TODO 文档未体现 移除蜡烛和提交
// 移出提交
let
submit
=
cc
.
find
(
'
right_down/btn_submit
'
,
this
.
node
);
submit
.
off
(
'
click
'
);
// submit.x = -120;
submit
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
submit
);
cc
.
tween
(
submit
)
.
to
(
0.5
,
{
x
:
120
})
.
call
(()
=>
{
submit
.
active
=
false
;
})
.
start
();
// 移除蜡烛燃烧回调
// 移除蜡烛燃烧回调
if
(
this
.
_schedule_candle
)
{
if
(
this
.
_schedule_candle
)
{
this
.
_timeout
=
0
;
this
.
_timeout
=
0
;
this
.
unschedule
(
this
.
_schedule_candle
);
this
.
unschedule
(
this
.
_schedule_candle
);
this
.
_schedule_candle
=
null
;
// 移除蜡烛 schedule
this
.
_schedule_candle
=
null
;
// 移除蜡烛 schedule
}
// 移出蜡烛
let
candle
=
cc
.
find
(
'
left_down/candle
'
,
this
.
node
);
candle
.
active
=
true
;
// candle.x = 80;
cc
.
Tween
.
stopAllByTarget
(
candle
);
cc
.
tween
(
candle
).
to
(
0.5
,
{
x
:
-
80
}).
start
();
// TODO 开始测评 使用setTimeout 模拟
setTimeout
(()
=>
{
// this.playLocalAudio('voice_test_excellent');
// // 显示贴图
// let layout = cc.find('right_up/layout', this.node);
// layout.active = true;
// let curTag = layout.children[this._curPage];
// if (curTag) {
// curTag.getChildByName('bule').active = false;
// curTag.getChildByName('red').active = false;
// let tag = curTag.getChildByName('tag');
// tag.active = true;
// tag.opacity = 0;
// tag.scale = 0.5;
// cc.tween(tag).to(0.7, { opacity: 255, scale: 1.2 }).to(0.2, { scale: 1 }).start();
// }
// let excellent = cc.find('excellent_ske', this.node);
// excellent.active = true;
// let dragonBones_excellent = excellent.getComponent(dragonBones.ArmatureDisplay);
// dragonBones_excellent.playAnimation('newAnimation', 1);
this
.
playLocalAudio
(
'
voice_test_nice_try
'
);
let
layout
=
cc
.
find
(
'
right_up/layout
'
,
this
.
node
);
layout
.
active
=
true
;
let
curTag
=
layout
.
children
[
this
.
_curPage
];
if
(
curTag
)
{
curTag
.
getChildByName
(
'
bule
'
).
active
=
false
;
curTag
.
getChildByName
(
'
tag
'
).
active
=
false
;
curTag
.
getChildByName
(
'
red
'
).
active
=
true
;
}
}
let
winSizeH
=
this
.
node
.
height
;
// 移出蜡烛
let
candle
=
cc
.
find
(
'
left_down/candle
'
,
this
.
node
);
candle
.
active
=
true
;
// candle.x = 80;
cc
.
Tween
.
stopAllByTarget
(
candle
);
cc
.
tween
(
candle
).
to
(
0.5
,
{
x
:
-
80
}).
start
();
res
=
JSON
.
parse
(
res
);
if
(
res
[
'
result
'
].
overall
<
80
)
{
this
.
_results
[
this
.
_curPage
]
=
false
;
// 移入测评nice try
this
.
playLocalAudio
(
'
voice_test_nice_try
'
);
let
test_nice_try
=
cc
.
find
(
'
test_nice_try
'
,
this
.
node
);
cc
.
Tween
.
stopAllByTarget
(
test_nice_try
);
let
layout
=
cc
.
find
(
'
right_up/layout
'
,
this
.
node
);
test_nice_try
.
x
=
0
;
layout
.
active
=
true
;
test_nice_try
.
y
=
winSizeH
*
0.5
+
400
;
let
curTag
=
layout
.
children
[
this
.
_curPage
];
test_nice_try
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
test_nice_try
);
cc
.
tween
(
test_nice_try
)
.
to
(
0.7
,
{
y
:
0
},
{
easing
:
'
backOut
'
})
.
delay
(
1
)
.
to
(
0.3
,
{
y
:
-
winSizeH
*
0.5
-
400
},
{
easing
:
'
sineIn
'
})
.
call
(()
=>
{
test_nice_try
.
active
=
true
;
})
.
start
();
// cc.Tween.stopAllByTarget(test_nice_try);
if
(
curTag
)
{
// cc.tween(test_nice_try)
curTag
.
getChildByName
(
'
bule
'
).
active
=
false
;
// .to(0.5, { y: -winSizeH * 0.1 }, { easing: 'sineIn' })
curTag
.
getChildByName
(
'
tag
'
).
active
=
false
;
// .to(0.2, { y: 0 }, { easing: 'sineOut' })
curTag
.
getChildByName
(
'
red
'
).
active
=
true
;
// .delay(1)
}
// .to(0.3, { y: -winSizeH * 0.5 - 400 }, { easing: 'sineIn' })
// 移入测评nice try
// .call(() => {
let
test_nice_try
=
cc
.
find
(
'
test_nice_try
'
,
this
.
node
);
// test_nice_try.active = true;
// })
cc
.
Tween
.
stopAllByTarget
(
test_nice_try
);
// .start();
test_nice_try
.
x
=
0
;
},
3000
);
test_nice_try
.
y
=
this
.
node
.
height
*
0.5
+
400
;
}
test_nice_try
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
test_nice_try
);
cc
.
tween
(
test_nice_try
)
.
to
(
0.7
,
{
y
:
0
},
{
easing
:
'
backOut
'
})
.
delay
(
1
)
.
to
(
0.3
,
{
y
:
-
this
.
node
.
height
*
0.5
-
400
},
{
easing
:
'
sineIn
'
})
.
call
(()
=>
{
test_nice_try
.
active
=
false
;
})
.
start
();
stopTest
()
{
// cc.tween(test_nice_try)
// window['courseware'].stopTest((res) => {
// .to(0.5, { y: -this.node.height * 0.1 }, { easing: 'sineIn' })
// console.log(res);
// .to(0.2, { y: 0 }, { easing: 'sineOut' })
// console.log(res.overall);
// .delay(1)
// });
// .to(0.3, { y: -this.node.height * 0.5 - 400 }, { easing: 'sineIn' })
// .call(() => {
// test_nice_try.active = true;
// })
// .start();
}
else
{
this
.
_results
[
this
.
_curPage
]
=
true
;
this
.
playLocalAudio
(
'
voice_test_excellent
'
);
// 显示贴图
let
layout
=
cc
.
find
(
'
right_up/layout
'
,
this
.
node
);
layout
.
active
=
true
;
let
curTag
=
layout
.
children
[
this
.
_curPage
];
if
(
curTag
)
{
curTag
.
getChildByName
(
'
bule
'
).
active
=
false
;
curTag
.
getChildByName
(
'
red
'
).
active
=
false
;
let
tag
=
curTag
.
getChildByName
(
'
tag
'
);
tag
.
active
=
true
;
tag
.
opacity
=
0
;
tag
.
scale
=
0.5
;
cc
.
tween
(
tag
).
to
(
0.7
,
{
opacity
:
255
,
scale
:
1.2
}).
to
(
0.2
,
{
scale
:
1
}).
start
();
}
let
test_excellent
=
cc
.
find
(
'
test_excellent
'
,
this
.
node
);
test_excellent
.
active
=
true
;
let
dragonBones_test_excellent
=
test_excellent
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonBones_test_excellent
.
playAnimation
(
'
newAnimation
'
,
1
);
dragonBones_test_excellent
.
off
(
dragonBones
.
EventObject
.
COMPLETE
);
dragonBones_test_excellent
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
test_excellent
.
active
=
false
;
});
}
this
.
unschedule
(
this
.
completeGame
);
this
.
scheduleOnce
(
this
.
completeGame
,
1
);
});
}
}
completeGame
()
{
completeGame
()
{
// 渐显遮罩
let
mask
=
cc
.
find
(
'
mask
'
,
this
.
node
);
let
mask
=
cc
.
find
(
'
mask
'
,
this
.
node
);
mask
.
opacity
=
0
;
mask
.
opacity
=
255
;
mask
.
active
=
true
;
// 移出pc
cc
.
Tween
.
stopAllByTarget
(
mask
);
let
pc
=
cc
.
find
(
'
down/pc
'
,
this
.
node
);
cc
.
tween
(
mask
)
// pc.x = 0;
.
to
(
0.5
,
{
opacity
:
0
})
pc
.
active
=
true
;
.
call
(()
=>
{})
cc
.
Tween
.
stopAllByTarget
(
pc
);
cc
.
tween
(
pc
)
.
to
(
0.5
,
{
x
:
-
this
.
node
.
width
/
2
-
400
})
.
start
();
.
start
();
this
.
overTime
();
}
}
selectRight
()
{
selectRight
()
{
...
@@ -647,6 +665,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -647,6 +665,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
tween
(
pc
)
cc
.
tween
(
pc
)
.
to
(
0.5
,
{
y
:
0
})
.
to
(
0.5
,
{
y
:
0
})
.
call
(()
=>
{
.
call
(()
=>
{
cc
.
find
(
'
down/cake
'
,
this
.
node
).
active
=
false
;
// 移入提交
// 移入提交
let
submit
=
cc
.
find
(
'
right_down/btn_submit
'
,
self
.
node
);
let
submit
=
cc
.
find
(
'
right_down/btn_submit
'
,
self
.
node
);
submit
.
off
(
'
click
'
);
submit
.
off
(
'
click
'
);
...
@@ -654,18 +674,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -654,18 +674,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
submit
.
active
=
true
;
submit
.
active
=
true
;
cc
.
Tween
.
stopAllByTarget
(
submit
);
cc
.
Tween
.
stopAllByTarget
(
submit
);
cc
.
tween
(
submit
).
to
(
0.5
,
{
x
:
-
120
}).
start
();
cc
.
tween
(
submit
).
to
(
0.5
,
{
x
:
-
120
}).
start
();
submit
.
once
(
'
click
'
,
()
=>
{
console
.
log
(
'
点击提交,结束录音,开始测评
'
);
// 移除蜡烛燃烧回调
if
(
self
.
_schedule_candle
)
{
self
.
_timeout
=
0
;
self
.
unschedule
(
self
.
_schedule_candle
);
self
.
_schedule_candle
=
null
;
// 移除蜡烛 schedule
}
// 开始测评(结束录音)
self
.
startTest
();
});
// 移除蜡烛燃烧回调
// 移除蜡烛燃烧回调
if
(
self
.
_schedule_candle
)
{
if
(
self
.
_schedule_candle
)
{
...
@@ -687,9 +695,45 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -687,9 +695,45 @@ export default class SceneComponent extends MyCocosSceneComponent {
cake_fire
.
active
=
true
;
cake_fire
.
active
=
true
;
cake_timeout
.
active
=
false
;
cake_timeout
.
active
=
false
;
// 播放骨骼动画
let
frame
=
cc
.
find
(
'
down/pc/frame
'
,
self
.
node
);
let
replay
=
cc
.
find
(
'
down/pc/frame/btn_replay
'
,
self
.
node
);
replay
.
active
=
false
;
replay
.
on
(
'
click
'
,
()
=>
{
if
(
self
.
_replaying
)
return
;
self
.
asyncLoadDragonBoneAnime
(
frame
,
problem
.
dragonBoneData
).
then
((
node
:
cc
.
Node
)
=>
{
self
.
_replaying
=
true
;
let
dragonBones_test
=
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonBones_test
.
playAnimation
(
'
newAnimation
'
,
1
);
dragonBones_test
.
off
(
dragonBones
.
EventObject
.
COMPLETE
);
dragonBones_test
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
node
.
destroy
();
node
=
null
;
replay
.
active
=
true
;
self
.
_replaying
=
false
;
});
});
});
self
.
asyncLoadDragonBoneAnime
(
frame
,
problem
.
dragonBoneData
).
then
((
node
:
cc
.
Node
)
=>
{
let
dragonBones_test
=
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonBones_test
.
playAnimation
(
'
newAnimation
'
,
1
);
dragonBones_test
.
off
(
dragonBones
.
EventObject
.
COMPLETE
);
dragonBones_test
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
node
.
destroy
();
node
=
null
;
replay
.
active
=
true
;
});
});
// 播放语音评测引导音频
// 播放语音评测引导音频
self
.
playAudioByUrl
(
self
.
data
.
guideAudio
,
()
=>
{
self
.
playAudioByUrl
(
self
.
data
.
guideAudio
,
()
=>
{
// TODO 开始录音
// 开始评测
this
.
startTest
(
problem
.
text
);
self
.
_timeout
=
problem
.
testWaitTime
;
self
.
_timeout
=
problem
.
testWaitTime
;
// 蜡烛燃烧回调
// 蜡烛燃烧回调
...
@@ -704,8 +748,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -704,8 +748,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
cake_fire
.
active
=
false
;
cake_fire
.
active
=
false
;
self
.
_timeout
=
0
;
self
.
_timeout
=
0
;
// 开始测评(结束录音)
console
.
log
(
'
蜡烛燃尽
'
);
self
.
st
art
Test
();
self
.
st
op
Test
();
}
else
if
(
ratio
<=
0.2
)
{
}
else
if
(
ratio
<=
0.2
)
{
cake_fire
.
active
=
false
;
cake_fire
.
active
=
false
;
cake_timeout
.
active
=
true
;
cake_timeout
.
active
=
true
;
...
@@ -717,18 +761,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -717,18 +761,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
};
};
// 蜡烛开始燃烧
// 蜡烛开始燃烧
self
.
schedule
(
self
.
_schedule_candle
);
self
.
schedule
(
self
.
_schedule_candle
);
});
// 播放骨骼动画
submit
.
once
(
'
click
'
,
()
=>
{
let
frame
=
cc
.
find
(
'
down/pc/frame
'
,
self
.
node
);
console
.
log
(
'
点击提交=
'
);
self
.
asyncLoadDragonBoneAnime
(
frame
,
problem
.
dragonBoneData
).
then
((
node
:
cc
.
Node
)
=>
{
// 移除蜡烛燃烧回调
let
dragonBones_test
=
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
if
(
self
.
_schedule_candle
)
{
dragonBones_test
.
playAnimation
(
'
newAnimation
'
,
1
)
;
self
.
_timeout
=
0
;
dragonBones_test
.
off
(
dragonBones
.
EventObject
.
COMPLETE
);
self
.
unschedule
(
self
.
_schedule_candle
);
dragonBones_test
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
self
.
_schedule_candle
=
null
;
// 移除蜡烛 schedule
node
.
active
=
false
;
}
node
.
destroy
();
node
=
null
;
self
.
stopTest
()
;
});
});
});
});
})
})
...
@@ -802,16 +845,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -802,16 +845,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
for
(
let
index
=
0
;
index
<
this
.
_results
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
this
.
_results
.
length
;
index
++
)
{
if
(
this
.
_results
[
index
])
numRight
++
;
if
(
this
.
_results
[
index
])
numRight
++
;
}
}
if
(
numRight
/
this
.
_results
.
length
<
0.6
)
{
if
(
numRight
===
this
.
_results
.
length
)
{
this
.
comeOn
();
this
.
allRight
();
}
else
{
}
else
{
this
.
niceTry
();
if
(
numRight
/
this
.
_results
.
length
<
0.6
)
{
this
.
comeOn
();
}
else
{
this
.
niceTry
();
}
}
}
}
else
{
}
else
{
// 开始下一题
// 开始下一题
this
.
_curPage
++
;
this
.
_curPage
++
;
this
.
resetGame
();
this
.
resetGame
();
// 移出pc
let
pc
=
cc
.
find
(
'
down/pc
'
,
this
.
node
);
if
(
pc
.
active
)
{
// pc.x = 0;
cc
.
Tween
.
stopAllByTarget
(
pc
);
cc
.
tween
(
pc
)
.
to
(
0.5
,
{
x
:
-
this
.
node
.
width
/
2
-
400
,
active
:
true
})
.
call
(()
=>
{
pc
.
active
=
false
;
})
.
start
();
}
this
.
initGame
();
this
.
initGame
();
}
}
}
}
...
@@ -819,7 +880,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -819,7 +880,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
comeOn
()
{
comeOn
()
{
let
pc
=
cc
.
find
(
'
down/pc
'
,
this
.
node
);
let
pc
=
cc
.
find
(
'
down/pc
'
,
this
.
node
);
if
(
pc
.
active
)
{
if
(
pc
.
active
)
{
// TODO 文档未体现
this
.
playLocalAudio
(
'
game_over_came_on
'
);
this
.
playLocalAudio
(
'
game_over_came_on
'
);
let
come_on
=
cc
.
find
(
'
come_on
'
,
this
.
node
);
let
come_on
=
cc
.
find
(
'
come_on
'
,
this
.
node
);
cc
.
Tween
.
stopAllByTarget
(
come_on
);
cc
.
Tween
.
stopAllByTarget
(
come_on
);
...
@@ -835,6 +895,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -835,6 +895,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
})
.
start
();
.
start
();
}
else
{
}
else
{
// TODO 文档未体现
// 移入pc
// 移入pc
cc
.
Tween
.
stopAllByTarget
(
pc
);
cc
.
Tween
.
stopAllByTarget
(
pc
);
pc
.
x
=
0
;
pc
.
x
=
0
;
...
@@ -843,6 +905,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -843,6 +905,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
tween
(
pc
)
cc
.
tween
(
pc
)
.
to
(
0.5
,
{
y
:
0
})
.
to
(
0.5
,
{
y
:
0
})
.
call
(()
=>
{
.
call
(()
=>
{
cc
.
find
(
'
down/cake
'
,
this
.
node
).
active
=
false
;
this
.
playLocalAudio
(
'
game_over_came_on
'
);
this
.
playLocalAudio
(
'
game_over_came_on
'
);
let
come_on
=
cc
.
find
(
'
come_on
'
,
this
.
node
);
let
come_on
=
cc
.
find
(
'
come_on
'
,
this
.
node
);
cc
.
Tween
.
stopAllByTarget
(
come_on
);
cc
.
Tween
.
stopAllByTarget
(
come_on
);
...
@@ -860,6 +924,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -860,6 +924,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
})
.
start
();
.
start
();
}
}
// cc.tween(come_on)
// cc.tween(come_on)
// .to(0.5, { y: -this.node.height * 0.1 }, { easing: 'sineIn' })
// .to(0.5, { y: -this.node.height * 0.1 }, { easing: 'sineIn' })
// .to(0.2, { y: 0 }, { easing: 'sineOut' })
// .to(0.2, { y: 0 }, { easing: 'sineOut' })
...
@@ -874,8 +939,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -874,8 +939,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
niceTry
()
{
niceTry
()
{
let
pc
=
cc
.
find
(
'
down/pc
'
,
this
.
node
);
let
pc
=
cc
.
find
(
'
down/pc
'
,
this
.
node
);
if
(
pc
.
active
)
{
if
(
pc
.
active
)
{
// TODO 文档未体现
this
.
playLocalAudio
(
'
game_over_nice_try
'
);
this
.
playLocalAudio
(
'
game_over_nice_try
'
);
let
nice_try
=
cc
.
find
(
'
nice_try
'
,
this
.
node
);
let
nice_try
=
cc
.
find
(
'
nice_try
'
,
this
.
node
);
cc
.
Tween
.
stopAllByTarget
(
nice_try
);
cc
.
Tween
.
stopAllByTarget
(
nice_try
);
nice_try
.
x
=
0
;
nice_try
.
x
=
0
;
...
@@ -890,6 +955,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -890,6 +955,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
})
.
start
();
.
start
();
}
else
{
}
else
{
// TODO 文档未体现
// 移入pc
// 移入pc
cc
.
Tween
.
stopAllByTarget
(
pc
);
cc
.
Tween
.
stopAllByTarget
(
pc
);
pc
.
x
=
0
;
pc
.
x
=
0
;
...
@@ -898,6 +965,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -898,6 +965,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
tween
(
pc
)
cc
.
tween
(
pc
)
.
to
(
0.5
,
{
y
:
0
})
.
to
(
0.5
,
{
y
:
0
})
.
call
(()
=>
{
.
call
(()
=>
{
cc
.
find
(
'
down/cake
'
,
this
.
node
).
active
=
false
;
this
.
playLocalAudio
(
'
game_over_nice_try
'
);
this
.
playLocalAudio
(
'
game_over_nice_try
'
);
let
nice_try
=
cc
.
find
(
'
nice_try
'
,
this
.
node
);
let
nice_try
=
cc
.
find
(
'
nice_try
'
,
this
.
node
);
cc
.
Tween
.
stopAllByTarget
(
nice_try
);
cc
.
Tween
.
stopAllByTarget
(
nice_try
);
...
@@ -928,11 +997,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -928,11 +997,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
allRight
()
{
allRight
()
{
this
.
playLocalAudio
(
'
all_right
'
);
let
pc
=
cc
.
find
(
'
down/pc
'
,
this
.
node
);
let
pc
=
cc
.
find
(
'
down/pc
'
,
this
.
node
);
if
(
pc
.
active
)
{
if
(
pc
.
active
)
{
// TODO 文档未体现
this
.
playLocalAudio
(
'
all_right
'
);
let
all_right
=
cc
.
find
(
'
all_right
'
,
this
.
node
);
let
all_right
=
cc
.
find
(
'
all_right
'
,
this
.
node
);
all_right
.
active
=
true
;
all_right
.
active
=
true
;
...
@@ -943,6 +1011,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -943,6 +1011,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
all_right
.
active
=
false
;
all_right
.
active
=
false
;
});
});
}
else
{
}
else
{
// TODO 文档未体现
this
.
playLocalAudio
(
'
all_right
'
);
// 移入pc
// 移入pc
cc
.
Tween
.
stopAllByTarget
(
pc
);
cc
.
Tween
.
stopAllByTarget
(
pc
);
pc
.
x
=
0
;
pc
.
x
=
0
;
...
@@ -951,6 +1022,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -951,6 +1022,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
tween
(
pc
)
cc
.
tween
(
pc
)
.
to
(
0.5
,
{
y
:
0
})
.
to
(
0.5
,
{
y
:
0
})
.
call
(()
=>
{
.
call
(()
=>
{
cc
.
find
(
'
down/cake
'
,
this
.
node
).
active
=
false
;
let
all_right
=
cc
.
find
(
'
all_right
'
,
this
.
node
);
let
all_right
=
cc
.
find
(
'
all_right
'
,
this
.
node
);
all_right
.
active
=
true
;
all_right
.
active
=
true
;
...
...
assets/cake/scene/cocos_generator.fire
deleted
100644 → 0
View file @
05f8ab0c
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": false,
"_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,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": true,
"_id": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 24
},
{
"__id__": 25
},
{
"__id__": 26
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
640,
360,
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": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
362.85545494732423,
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": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_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": "32MJMZ2HRGF4BOf533Avyi"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8288e3d4-4c75-4b27-8f01-f7014417f4dd"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "97/S6HDq9MeqgmV1Zwnhbb"
},
{
"__type__": "cc.Node",
"_name": "bottomPart",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 8
},
{
"__id__": 11
}
],
"_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": [
635.132,
-356.326,
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": "8c7k8ep/ZFNpO263+1QHz9"
},
{
"__type__": "cc.Node",
"_name": "btn_left",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 10
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 61,
"height": 67
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-148.464,
34,
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": "5ad2wLQLxIN5Eg7OHecSH6"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "84mqOgJ3JNqZrYVTEU8CjE"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "bcYN/4EKBJhbIAfovo9Ah1"
},
{
"__type__": "cc.Node",
"_name": "btn_right",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
},
{
"__id__": 13
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60,
"height": 66
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-47.164,
34,
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": "46i3stdzpHX6zQHTGnRsNE"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "42Sh8QS/BHn4WiGyPQPKPt"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "1aj32fYY1IxLesa77E70Qu"
},
{
"__type__": "cc.Node",
"_name": "res",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 15
},
{
"__id__": 18
},
{
"__id__": 21
}
],
"_active": false,
"_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": "0aAzbH6R1E+6AmGRrkKa5O"
},
{
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 16
}
],
"_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": "9bLfcYeeNKrr524vzWchiM"
},
{
"__type__": "cc.Node",
"_name": "BRLNSDB",
"_objFlags": 0,
"_parent": {
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
}
],
"_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": "cfMLGsq0BMhJARv+ySMAxS"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "9bNHNPu5lC7rQYyr8ai/sY"
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 19
}
],
"_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": "53LUHHG2pEr79fyrvazXJs"
},
{
"__type__": "cc.Node",
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 18
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 20
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 138,
"height": 141
},
"_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": "1blU2OArJIfoC9XfupGxJG"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "03GEWUEZJGyKormWgIWCtM"
},
{
"__type__": "cc.Node",
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 22
}
],
"_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": "d9f+b0lmZGSJJae6zrADhp"
},
{
"__type__": "cc.Node",
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
}
],
"_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": "e87DSaFCVJfb2PAUkf4/o7"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_clip": {
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "dey05oKrBIspvsDa6pOIQz"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": true,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_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": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "408a6f4ZfpM8Yzyg+IOGg/V",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "eaTVUpqahPfZeO9+sUI7RP"
}
]
\ No newline at end of file
assets/cake/scene/cocos_generator.fire.meta
deleted
100644 → 0
View file @
05f8ab0c
{
"ver": "1.2.9",
"uuid": "0737ce42-24f0-45c6-8e1a-8bdab4f74ba3",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
"subMetas": {}
}
\ No newline at end of file
assets/cake/scene/cocos_generator.ts
deleted
100644 → 0
View file @
05f8ab0c
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
SceneComponent
extends
MyCocosSceneComponent
{
addPreloadImage
()
{
// TODO 根据自己的配置预加载图片资源
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url
});
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url_2
});
}
addPreloadAudio
()
{
// TODO 根据自己的配置预加载音频资源
this
.
_audioResList
.
push
({
url
:
this
.
data
.
audio_url
});
}
addPreloadAnima
()
{
}
onLoadEnd
()
{
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this
.
initData
();
this
.
initView
();
this
.
initListener
();
}
_cantouch
=
null
;
initData
()
{
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
}
initView
()
{
this
.
initBg
();
this
.
initPic
();
this
.
initBtn
();
this
.
initIcon
();
}
initBg
()
{
const
bgNode
=
cc
.
find
(
'
Canvas/bg
'
);
bgNode
.
scale
=
this
.
_mapScaleMax
;
}
pic1
=
null
;
pic2
=
null
;
initPic
()
{
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
maxW
=
canvas
.
width
*
0.7
;
this
.
getSprNodeByUrl
(
this
.
data
.
pic_url
,
(
sprNode
)
=>
{
const
picNode1
=
sprNode
;
picNode1
.
scale
=
maxW
/
picNode1
.
width
;
picNode1
.
baseX
=
picNode1
.
x
;
canvas
.
addChild
(
picNode1
);
this
.
pic1
=
picNode1
;
const
labelNode
=
new
cc
.
Node
();
labelNode
.
color
=
cc
.
Color
.
YELLOW
;
const
label
=
labelNode
.
addComponent
(
cc
.
Label
);
label
.
string
=
this
.
data
.
text
;
label
.
fontSize
=
60
;
label
.
lineHeight
=
60
;
label
.
font
=
cc
.
find
(
'
Canvas/res/font/BRLNSDB
'
).
getComponent
(
'
cc.Label
'
).
font
;
picNode1
.
addChild
(
labelNode
);
});
this
.
getSprNodeByUrl
(
this
.
data
.
pic_url_2
,
(
sprNode
)
=>
{
const
picNode2
=
sprNode
;
picNode2
.
scale
=
maxW
/
picNode2
.
width
;
canvas
.
addChild
(
picNode2
);
picNode2
.
x
=
canvas
.
width
;
picNode2
.
baseX
=
picNode2
.
x
;
this
.
pic2
=
picNode2
;
const
labelNode
=
new
cc
.
Node
();
const
label
=
labelNode
.
addComponent
(
cc
.
RichText
);
const
size
=
60
label
.
font
=
cc
.
find
(
'
Canvas/res/font/BRLNSDB
'
).
getComponent
(
cc
.
Label
).
font
;
label
.
string
=
`<outline color=#751e00 width=4><size=
${
size
}
><color=#ffffff>
${
this
.
data
.
text
}
</color></size></outline>`
label
.
lineHeight
=
size
;
picNode2
.
addChild
(
labelNode
);
});
}
initIcon
()
{
const
iconNode
=
this
.
getSprNode
(
'
icon
'
);
iconNode
.
zIndex
=
5
;
iconNode
.
anchorX
=
1
;
iconNode
.
anchorY
=
1
;
iconNode
.
parent
=
cc
.
find
(
'
Canvas
'
);
iconNode
.
x
=
iconNode
.
parent
.
width
/
2
-
10
;
iconNode
.
y
=
iconNode
.
parent
.
height
/
2
-
10
;
iconNode
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
()
=>
{
this
.
playAudioByUrl
(
this
.
data
.
audio_url
);
})
}
curPage
=
null
;
initBtn
()
{
this
.
curPage
=
0
;
const
bottomPart
=
cc
.
find
(
'
Canvas/bottomPart
'
);
bottomPart
.
zIndex
=
5
;
// 提高层级
bottomPart
.
x
=
bottomPart
.
parent
.
width
/
2
;
bottomPart
.
y
=
-
bottomPart
.
parent
.
height
/
2
;
const
leftBtnNode
=
bottomPart
.
getChildByName
(
'
btn_left
'
);
//节点中添加了button组件 则可以添加click事件监听
leftBtnNode
.
on
(
'
click
'
,
()
=>
{
if
(
!
this
.
_cantouch
)
{
return
;
}
if
(
this
.
curPage
==
0
)
{
return
;
}
this
.
curPage
=
0
this
.
leftMove
();
this
.
playLocalAudio
(
'
btn
'
);
})
const
rightBtnNode
=
bottomPart
.
getChildByName
(
'
btn_right
'
);
//节点中添加了button组件 则可以添加click事件监听
rightBtnNode
.
on
(
'
click
'
,
()
=>
{
if
(
!
this
.
_cantouch
)
{
return
;
}
if
(
this
.
curPage
==
1
)
{
return
;
}
this
.
curPage
=
1
this
.
rightMove
();
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish
();
this
.
playLocalAudio
(
'
btn
'
);
})
}
leftMove
()
{
this
.
_cantouch
=
false
;
const
len
=
this
.
pic1
.
parent
.
width
;
cc
.
tween
(
this
.
pic1
)
.
to
(
1
,
{
x
:
this
.
pic1
.
baseX
},
{
easing
:
'
cubicInOut
'
})
.
start
();
cc
.
tween
(
this
.
pic2
)
.
to
(
1
,
{
x
:
this
.
pic2
.
baseX
},
{
easing
:
'
cubicInOut
'
})
.
call
(()
=>
{
this
.
_cantouch
=
true
;
})
.
start
();
}
rightMove
()
{
this
.
_cantouch
=
false
;
const
len
=
this
.
pic1
.
parent
.
width
;
cc
.
tween
(
this
.
pic1
)
.
to
(
1
,
{
x
:
this
.
pic1
.
baseX
-
len
},
{
easing
:
'
cubicInOut
'
})
.
start
();
cc
.
tween
(
this
.
pic2
)
.
to
(
1
,
{
x
:
this
.
pic2
.
baseX
-
len
},
{
easing
:
'
cubicInOut
'
})
.
call
(()
=>
{
this
.
_cantouch
=
true
;
})
.
start
();
}
// update (dt) {},
initListener
()
{
}
playLocalAudio
(
audioName
)
{
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
return
new
Promise
((
resolve
,
reject
)
=>
{
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
(
id
);
});
})
}
}
assets/cake/scene/cocos_generator.ts.meta
deleted
100644 → 0
View file @
05f8ab0c
{
"ver": "1.0.8",
"uuid": "408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/cake/textures/切图/test_nice_try.png.meta
View file @
c349b15f
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable":
tru
e,
"packable":
fals
e,
"width": 378,
"width": 378,
"height": 192,
"height": 192,
"platformSettings": {},
"platformSettings": {},
...
...
bin/buildCocos.js
View file @
c349b15f
const
{
spawn
}
=
require
(
"
child_process
"
);
const
{
spawn
}
=
require
(
'
child_process
'
);
const
fs
=
require
(
"
fs
"
);
const
fs
=
require
(
'
fs
'
);
const
compressing
=
require
(
'
compressing
'
);
const
compressing
=
require
(
'
compressing
'
);
const
{
v4
,
parse
}
=
require
(
'
uuid
'
);
const
{
v4
,
parse
}
=
require
(
'
uuid
'
);
const
{
Base64
}
=
require
(
'
js-base64
'
);
const
{
Base64
}
=
require
(
'
js-base64
'
);
const
{
copyDir
,
removeDir
,
fix2
}
=
require
(
"
./utils
"
);
const
{
copyDir
,
removeDir
,
fix2
}
=
require
(
'
./utils
'
);
async
function
buildForm
()
{
async
function
buildForm
()
{
const
paths
=
fs
.
readdirSync
(
'
form
'
);
const
paths
=
fs
.
readdirSync
(
'
form
'
);
if
(
!
paths
.
includes
(
'
tsconfig.json
'
))
{
if
(
!
paths
.
includes
(
'
tsconfig.json
'
))
{
await
copyDir
(
'
form
'
,
'
dist/form
'
);
await
copyDir
(
'
form
'
,
'
dist/form
'
);
return
;
return
;
}
}
if
(
process
.
platform
==
'
win32
'
)
{
if
(
process
.
platform
==
'
win32
'
)
{
await
execCmd
(
'
npm.cmd
'
,
[
'
install
'
],
'
form
'
);
await
execCmd
(
'
npm.cmd
'
,
[
'
install
'
],
'
form
'
);
}
else
{
}
else
{
await
execCmd
(
'
npm
'
,
[
'
install
'
],
'
form
'
);
await
execCmd
(
'
npm
'
,
[
'
install
'
],
'
form
'
);
}
}
if
(
process
.
platform
==
'
win32
'
)
{
if
(
process
.
platform
==
'
win32
'
)
{
await
execCmd
(
'
npm.cmd
'
,
[
'
run
'
,
'
publish
'
],
'
form
'
);
await
execCmd
(
'
npm.cmd
'
,
[
'
run
'
,
'
publish
'
],
'
form
'
);
}
else
{
}
else
{
await
execCmd
(
'
npm
'
,
[
'
run
'
,
'
publish
'
],
'
form
'
);
await
execCmd
(
'
npm
'
,
[
'
run
'
,
'
publish
'
],
'
form
'
);
}
}
await
compressing
.
zip
.
uncompress
(
'
form/publish/form.zip
'
,
'
dist/form
'
);
await
compressing
.
zip
.
uncompress
(
'
form/publish/form.zip
'
,
'
dist/form
'
);
}
}
function
execCmd
(
cmd
,
params
,
path
)
{
function
execCmd
(
cmd
,
params
,
path
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
buffer
=
spawn
(
const
buffer
=
spawn
(
cmd
,
params
,
{
cwd
:
path
});
cmd
,
params
,
buffer
.
stdout
.
on
(
'
data
'
,
(
data
)
=>
{
{
cwd
:
path
}
console
.
log
(
`stdout:
${
data
}
`
);
);
});
buffer
.
stdout
.
on
(
'
data
'
,
(
data
)
=>
{
buffer
.
stderr
.
on
(
'
data
'
,
(
data
)
=>
{
console
.
log
(
`stdout:
${
data
}
`
);
console
.
error
(
`stderr:
${
data
}
`
);
});
});
buffer
.
stderr
.
on
(
'
data
'
,
(
data
)
=>
{
buffer
.
on
(
'
close
'
,
(
code
)
=>
{
console
.
error
(
`stderr:
${
data
}
`
);
console
.
log
(
`child process exited with code
${
code
}
`
);
});
resolve
();
});
buffer
.
on
(
'
close
'
,
(
code
)
=>
{
});
console
.
log
(
`child process exited with code
${
code
}
`
);
resolve
();
});
});
}
}
let
creatorBasePath
=
'
D:/install/CocosDashboard_1.0.6/resources/.editors/Creator/2.4.5/CocosCreator.exe
'
;
let
creatorBasePath
=
'
CocosCreator
'
;
if
(
process
.
platform
!==
'
win32
'
)
{
if
(
process
.
platform
!==
'
win32
'
)
{
creatorBasePath
=
"
/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator
"
;
creatorBasePath
=
'
/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator
'
;
}
}
const
buildCocos
=
function
(
args
)
{
const
buildCocos
=
function
(
args
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
buffer
=
spawn
(
const
buffer
=
spawn
(
creatorBasePath
,
args
,
{
cwd
:
'
.
'
});
creatorBasePath
,
args
,
buffer
.
stdout
.
on
(
'
data
'
,
(
data
)
=>
{
{
cwd
:
'
.
'
}
console
.
log
(
`stdout:
${
data
}
`
);
);
});
buffer
.
stdout
.
on
(
'
data
'
,
(
data
)
=>
{
buffer
.
stderr
.
on
(
'
data
'
,
(
data
)
=>
{
console
.
log
(
`stdout:
${
data
}
`
);
console
.
error
(
`stderr:
${
data
}
`
);
});
});
buffer
.
stderr
.
on
(
'
data
'
,
(
data
)
=>
{
buffer
.
on
(
'
close
'
,
(
code
)
=>
{
console
.
error
(
`stderr:
${
data
}
`
);
console
.
log
(
`child process exited with code
${
code
}
`
);
});
resolve
();
});
buffer
.
on
(
'
close
'
,
(
code
)
=>
{
});
console
.
log
(
`child process exited with code
${
code
}
`
);
resolve
();
});
});
};
};
function
getReleaseFileName
(
projectName
)
{
function
getReleaseFileName
(
projectName
)
{
let
date
=
new
Date
();
let
date
=
new
Date
();
let
fileName
=
`
${
projectName
}
_
${
date
.
getFullYear
()}${
fix2
(
date
.
getMonth
()
+
1
)}${
fix2
(
date
.
getDate
())}
`
;
let
fileName
=
`
${
projectName
}
_
${
date
.
getFullYear
()}${
fix2
(
date
.
getMonth
()
+
1
)}${
fix2
(
date
.
getDate
())}
`
;
fileName
+=
`
${
fix2
(
date
.
getHours
())}
-
${
fix2
(
date
.
getMinutes
())}
-
${
fix2
(
date
.
getSeconds
())}
`
;
fileName
+=
`
${
fix2
(
date
.
getHours
())}
-
${
fix2
(
date
.
getMinutes
())}
-
${
fix2
(
date
.
getSeconds
())}
`
;
return
fileName
;
return
fileName
;
}
}
function
getFolderName
(
path
)
{
function
getFolderName
(
path
)
{
let
folderName
=
''
;
let
folderName
=
''
;
fs
.
readdirSync
(
path
).
find
(
fileName
=>
{
fs
.
readdirSync
(
path
).
find
((
fileName
)
=>
{
const
st
=
fs
.
statSync
(
`
${
path
}
/
${
fileName
}
`
);
const
st
=
fs
.
statSync
(
`
${
path
}
/
${
fileName
}
`
);
if
(
st
.
isDirectory
())
{
if
(
st
.
isDirectory
())
{
folderName
=
fileName
;
folderName
=
fileName
;
}
}
});
});
return
folderName
;
return
folderName
;
}
}
function
editFolderMeta
(
path
,
folderName
,
isBundle
)
{
function
editFolderMeta
(
path
,
folderName
,
isBundle
)
{
const
metaPath
=
`
${
path
}
/
${
folderName
}
.meta`
;
const
metaPath
=
`
${
path
}
/
${
folderName
}
.meta`
;
const
metaDataStr
=
fs
.
readFileSync
(
metaPath
);
const
metaDataStr
=
fs
.
readFileSync
(
metaPath
);
const
metaData
=
JSON
.
parse
(
metaDataStr
);
const
metaData
=
JSON
.
parse
(
metaDataStr
);
metaData
.
isBundle
=
isBundle
;
metaData
.
isBundle
=
isBundle
;
metaData
.
isRemoteBundle
=
{
metaData
.
isRemoteBundle
=
{
ios
:
isBundle
,
ios
:
isBundle
,
android
:
isBundle
android
:
isBundle
,
};
};
fs
.
writeFileSync
(
metaPath
,
JSON
.
stringify
(
metaData
));
fs
.
writeFileSync
(
metaPath
,
JSON
.
stringify
(
metaData
));
}
}
async
function
buildWebDesktop
()
{
async
function
buildWebDesktop
()
{
const
args
=
[
'
--path
'
,
'
./
'
,
'
--build
'
,
'
platform=web-desktop;debug=true
'
,
'
--force
'
];
const
args
=
[
'
--path
'
,
'
./
'
,
'
--build
'
,
'
platform=web-desktop;debug=true
'
,
'
--force
'
];
await
buildCocos
(
args
);
await
buildCocos
(
args
);
}
}
async
function
buildAndroidBundle
()
{
async
function
buildAndroidBundle
()
{
const
args
=
[
'
--path
'
,
'
./
'
,
'
--build
'
,
"
platform=ios;debug=false;md5Cache=true;buildPath=build_android;appABIs=['armeabi-v7a','x86','x86_64','arm64-v8a'];encryptJs=true;xxteaKey=6bbfce23-28b4-4a;zipCompressJs=true
"
,
'
--force
'
];
const
args
=
[
'
--path
'
,
'
./
'
,
'
--build
'
,
"
platform=ios;debug=false;md5Cache=true;buildPath=build_android;appABIs=['armeabi-v7a','x86','x86_64','arm64-v8a'];encryptJs=true;xxteaKey=6bbfce23-28b4-4a;zipCompressJs=true
"
,
'
--force
'
];
await
buildCocos
(
args
);
await
buildCocos
(
args
);
}
}
async
function
buildIosBundle
()
{
async
function
buildIosBundle
()
{
const
args
=
[
'
--path
'
,
'
./
'
,
'
--build
'
,
"
platform=ios;debug=false;md5Cache=true;buildPath=build_ios;encryptJs=true;xxteaKey=6bbfce23-28b4-4a;zipCompressJs=true
"
,
'
--force
'
];
const
args
=
[
'
--path
'
,
'
./
'
,
'
--build
'
,
'
platform=ios;debug=false;md5Cache=true;buildPath=build_ios;encryptJs=true;xxteaKey=6bbfce23-28b4-4a;zipCompressJs=true
'
,
'
--force
'
];
await
buildCocos
(
args
);
await
buildCocos
(
args
);
}
}
async
function
buildWebBundle
()
{
async
function
buildWebBundle
()
{
const
args
=
[
'
--path
'
,
'
./
'
,
'
--build
'
,
"
platform=web-desktop;debug=false;buildPath=build_web_desktop
"
,
'
--force
'
];
const
args
=
[
'
--path
'
,
'
./
'
,
'
--build
'
,
'
platform=web-desktop;debug=false;buildPath=build_web_desktop
'
,
'
--force
'
];
await
buildCocos
(
args
);
await
buildCocos
(
args
);
}
}
function
createConfigFile
(
projectName
,
type
)
{
function
createConfigFile
(
projectName
,
type
)
{
let
iosVersion
=
""
;
let
iosVersion
=
''
;
let
androidVersion
=
""
;
let
androidVersion
=
''
;
if
(
!
type
)
{
if
(
!
type
)
{
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidConfigFileName
=
androidPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
const
androidConfigFileName
=
androidPaths
.
find
((
path
)
=>
path
.
indexOf
(
'
config
'
)
==
0
);
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
const
iosPaths
=
fs
.
readdirSync
(
`dist/ios/
${
projectName
}
`
);
const
iosPaths
=
fs
.
readdirSync
(
`dist/ios/
${
projectName
}
`
);
const
iosConfigFileName
=
iosPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
const
iosConfigFileName
=
iosPaths
.
find
((
path
)
=>
path
.
indexOf
(
'
config
'
)
==
0
);
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
}
else
{
}
else
{
if
(
type
==
"
android
"
)
{
if
(
type
==
'
android
'
)
{
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidConfigFileName
=
androidPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
const
androidConfigFileName
=
androidPaths
.
find
((
path
)
=>
path
.
indexOf
(
'
config
'
)
==
0
);
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
}
else
{
}
else
{
const
iosPaths
=
fs
.
readdirSync
(
`dist/ios/
${
projectName
}
`
);
const
iosPaths
=
fs
.
readdirSync
(
`dist/ios/
${
projectName
}
`
);
const
iosConfigFileName
=
iosPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
const
iosConfigFileName
=
iosPaths
.
find
((
path
)
=>
path
.
indexOf
(
'
config
'
)
==
0
);
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
}
}
}
}
const
config
=
{
const
config
=
{
"
ios
"
:
{
ios
:
{
"
sceneName
"
:
projectName
,
sceneName
:
projectName
,
"
version
"
:
iosVersion
version
:
iosVersion
,
},
},
"
android
"
:
{
android
:
{
"
sceneName
"
:
projectName
,
sceneName
:
projectName
,
"
version
"
:
androidVersion
version
:
androidVersion
,
}
},
}
};
fs
.
writeFileSync
(
'
dist/config.json
'
,
JSON
.
stringify
(
config
));
fs
.
writeFileSync
(
'
dist/config.json
'
,
JSON
.
stringify
(
config
));
}
}
function
compressAll
(
projectName
)
{
function
compressAll
(
projectName
)
{
const
tarStream
=
new
compressing
.
zip
.
Stream
();
const
tarStream
=
new
compressing
.
zip
.
Stream
();
tarStream
.
addEntry
(
'
dist/play
'
);
tarStream
.
addEntry
(
'
dist/play
'
);
tarStream
.
addEntry
(
'
dist/form
'
);
tarStream
.
addEntry
(
'
dist/form
'
);
tarStream
.
addEntry
(
'
dist/ios
'
);
tarStream
.
addEntry
(
'
dist/ios
'
);
tarStream
.
addEntry
(
'
dist/android
'
);
tarStream
.
addEntry
(
'
dist/android
'
);
tarStream
.
addEntry
(
'
dist/web_desktop
'
);
tarStream
.
addEntry
(
'
dist/web_desktop
'
);
tarStream
.
addEntry
(
'
dist/config.json
'
);
tarStream
.
addEntry
(
'
dist/config.json
'
);
const
destStream
=
fs
.
createWriteStream
(
`publish/
${
getReleaseFileName
(
projectName
)}
.zip`
);
const
destStream
=
fs
.
createWriteStream
(
`publish/
${
getReleaseFileName
(
projectName
)}
.zip`
);
tarStream
.
pipe
(
destStream
);
tarStream
.
pipe
(
destStream
);
}
}
function
build_check
()
{
function
build_check
()
{
const
dirNames
=
process
.
cwd
().
split
(
/
\/
|
\\
/
);
const
dirNames
=
process
.
cwd
().
split
(
/
\/
|
\\
/
);
const
projectName
=
dirNames
[
dirNames
.
length
-
1
];
const
projectName
=
dirNames
[
dirNames
.
length
-
1
];
const
path
=
'
assets
'
const
path
=
'
assets
'
;
let
folderName
=
''
;
let
folderName
=
''
;
fs
.
readdirSync
(
path
).
find
(
fileName
=>
{
fs
.
readdirSync
(
path
).
find
((
fileName
)
=>
{
const
st
=
fs
.
statSync
(
`
${
path
}
/
${
fileName
}
`
);
const
st
=
fs
.
statSync
(
`
${
path
}
/
${
fileName
}
`
);
if
(
st
.
isDirectory
())
{
if
(
st
.
isDirectory
())
{
folderName
=
fileName
;
folderName
=
fileName
;
}
}
});
});
if
(
projectName
!=
folderName
)
{
if
(
projectName
!=
folderName
)
{
throw
(
`项目名(
${
projectName
}
)与bundle文件夹名(
${
folderName
}
)不相同`
)
;
throw
`项目名(
${
projectName
}
)与bundle文件夹名(
${
folderName
}
)不相同`
;
}
}
let
same
=
false
;
let
same
=
false
;
const
files
=
fs
.
readdirSync
(
`
${
path
}
/
${
folderName
}
/scene`
);
const
files
=
fs
.
readdirSync
(
`
${
path
}
/
${
folderName
}
/scene`
);
files
.
forEach
(
fileName
=>
{
files
.
forEach
((
fileName
)
=>
{
fileName
.
split
(
'
.
'
).
forEach
((
str
,
idx
,
arr
)
=>
{
fileName
.
split
(
'
.
'
).
forEach
((
str
,
idx
,
arr
)
=>
{
if
(
str
==
'
fire
'
)
{
if
(
str
==
'
fire
'
)
{
const
sceneName
=
arr
[
idx
-
1
];
const
sceneName
=
arr
[
idx
-
1
];
if
(
folderName
==
sceneName
)
{
if
(
folderName
==
sceneName
)
{
same
=
true
;
same
=
true
;
}
}
}
}
})
});
});
});
if
(
!
same
)
{
if
(
!
same
)
{
throw
(
`bundle文件夹名称(
${
folderName
}
)与scene名称不相同`
)
;
throw
`bundle文件夹名称(
${
folderName
}
)与scene名称不相同`
;
}
}
return
projectName
;
return
projectName
;
}
}
function
changeSettingToWebDesktop
()
{
function
changeSettingToWebDesktop
()
{
const
path
=
'
assets
'
const
path
=
'
assets
'
;
const
folderName
=
getFolderName
(
path
);
const
folderName
=
getFolderName
(
path
);
editFolderMeta
(
path
,
folderName
,
false
);
editFolderMeta
(
path
,
folderName
,
false
);
}
}
function
changeSettingsToBundle
()
{
function
changeSettingsToBundle
()
{
const
path
=
'
assets
'
const
path
=
'
assets
'
;
const
folderName
=
getFolderName
(
path
);
const
folderName
=
getFolderName
(
path
);
editFolderMeta
(
path
,
folderName
,
true
);
editFolderMeta
(
path
,
folderName
,
true
);
}
}
function
replaceUuids
()
{
function
replaceUuids
()
{
console
.
log
(
'
build_step_0 开始~!
'
);
console
.
log
(
'
build_step_0 开始~!
'
);
const
path
=
'
assets
'
;
const
path
=
'
assets
'
function
getFolderName
(
path
)
{
function
getFolderName
(
path
)
{
let
folderName
=
''
;
let
folderName
=
''
;
fs
.
readdirSync
(
path
).
find
((
fileName
)
=>
{
fs
.
readdirSync
(
path
).
find
(
fileName
=>
{
const
st
=
fs
.
statSync
(
`
${
path
}
/
${
fileName
}
`
);
const
st
=
fs
.
statSync
(
`
${
path
}
/
${
fileName
}
`
);
if
(
st
.
isDirectory
())
{
if
(
st
.
isDirectory
())
{
folderName
=
fileName
;
folderName
=
fileName
;
}
}
});
});
return
folderName
;
return
folderName
;
}
}
const
folderName
=
getFolderName
(
path
);
const
folderName
=
getFolderName
(
path
);
let
oldFireUuid
=
''
;
let
oldFireUuid
=
''
;
let
oldJsUuid
=
''
;
let
oldJsUuid
=
''
;
let
oldJsShortUuid
=
''
;
let
oldJsShortUuid
=
''
;
let
oldJsId
=
''
;
let
oldJsId
=
''
;
const
fireMetaStr
=
fs
.
readFileSync
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire.meta`
);
const
fireMetaStr
=
fs
.
readFileSync
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire.meta`
);
if
(
fireMetaStr
.
indexOf
(
'
57ea7c61-9b8b-498a-b024-c98ee9124beb
'
)
>
0
)
{
if
(
fireMetaStr
.
indexOf
(
'
57ea7c61-9b8b-498a-b024-c98ee9124beb
'
)
>
0
)
{
// 老Cocos脚手架
// 老Cocos脚手架
oldFireUuid
=
'
57ea7c61-9b8b-498a-b024-c98ee9124beb
'
;
oldFireUuid
=
'
57ea7c61-9b8b-498a-b024-c98ee9124beb
'
;
oldJsUuid
=
'
f4ede462-f8d7-4069-ba80-915611c058ca
'
;
oldJsUuid
=
'
f4ede462-f8d7-4069-ba80-915611c058ca
'
;
oldJsShortUuid
=
'
f4edeRi+NdAabqAkVYRwFjK
'
;
oldJsShortUuid
=
'
f4edeRi+NdAabqAkVYRwFjK
'
;
oldJsId
=
'
e687yyoRBIzZAOVRL8Sseh
'
;
oldJsId
=
'
e687yyoRBIzZAOVRL8Sseh
'
;
}
}
if
(
fireMetaStr
.
indexOf
(
'
0737ce42-24f0-45c6-8e1a-8bdab4f74ba3
'
)
>
0
)
{
if
(
fireMetaStr
.
indexOf
(
'
0737ce42-24f0-45c6-8e1a-8bdab4f74ba3
'
)
>
0
)
{
// 新Cocos脚手架
// 新Cocos脚手架
oldFireUuid
=
'
0737ce42-24f0-45c6-8e1a-8bdab4f74ba3
'
;
oldFireUuid
=
'
0737ce42-24f0-45c6-8e1a-8bdab4f74ba3
'
;
oldJsUuid
=
'
408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5
'
;
oldJsUuid
=
'
408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5
'
;
oldJsShortUuid
=
'
408a6f4ZfpM8Yzyg+IOGg/V
'
;
oldJsShortUuid
=
'
408a6f4ZfpM8Yzyg+IOGg/V
'
;
oldJsId
=
'
eaTVUpqahPfZeO9+sUI7RP
'
;
oldJsId
=
'
eaTVUpqahPfZeO9+sUI7RP
'
;
}
}
if
(
oldFireUuid
===
''
)
{
if
(
oldFireUuid
===
''
)
{
return
;
return
;
}
}
function
editFolderMeta
(
path
,
folderName
)
{
function
editFolderMeta
(
path
,
folderName
)
{
const
metaPath
=
`
${
path
}
/
${
folderName
}
.meta`
;
const
metaPath
=
`
${
path
}
/
${
folderName
}
.meta`
;
const
metaDataStr
=
fs
.
readFileSync
(
metaPath
);
const
metaDataStr
=
fs
.
readFileSync
(
metaPath
);
const
metaData
=
JSON
.
parse
(
metaDataStr
);
const
metaData
=
JSON
.
parse
(
metaDataStr
);
metaData
.
isBundle
=
false
;
metaData
.
isBundle
=
false
;
fs
.
writeFileSync
(
metaPath
,
JSON
.
stringify
(
metaData
));
fs
.
writeFileSync
(
metaPath
,
JSON
.
stringify
(
metaData
));
}
}
function
fileReplace
(
path
,
replaceStr
,
newStr
)
{
function
fileReplace
(
path
,
replaceStr
,
newStr
)
{
if
(
!
fs
.
existsSync
(
path
))
{
if
(
!
fs
.
existsSync
(
path
))
{
return
;
return
;
}
}
const
fileStr
=
fs
.
readFileSync
(
path
);
const
fileStr
=
fs
.
readFileSync
(
path
);
const
newFileStr
=
fileStr
.
toString
().
replace
(
new
RegExp
(
replaceStr
.
replace
(
/
[
.*+?^${}()|[
\]\\]
/g
,
'
\\
$&
'
),
'
g
'
),
newStr
);
const
newFileStr
=
fileStr
.
toString
().
replace
(
new
RegExp
(
replaceStr
.
replace
(
/
[
.*+?^${}()|[
\]\\]
/g
,
"
\\
$&
"
),
'
g
'
),
newStr
);
fs
.
writeFileSync
(
path
,
newFileStr
);
fs
.
writeFileSync
(
path
,
newFileStr
);
}
}
function
getShortUuid
(
uuid
)
{
function
getShortUuid
(
uuid
)
{
const
bytes
=
parse
(
uuid
).
subarray
(
1
);
const
bytes
=
parse
(
uuid
).
subarray
(
1
);
return
uuid
.
substring
(
0
,
5
)
+
Base64
.
fromUint8Array
(
bytes
).
substring
(
2
);
return
uuid
.
substring
(
0
,
5
)
+
Base64
.
fromUint8Array
(
bytes
).
substring
(
2
);
}
}
editFolderMeta
(
path
,
folderName
);
editFolderMeta
(
path
,
folderName
);
const
newFireUuid
=
v4
();
const
newFireUuid
=
v4
();
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire.meta`
,
oldFireUuid
,
newFireUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire.meta`
,
oldFireUuid
,
newFireUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire`
,
oldFireUuid
,
newFireUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire`
,
oldFireUuid
,
newFireUuid
);
fileReplace
(
'
settings/builder.json
'
,
oldFireUuid
,
newFireUuid
);
fileReplace
(
'
settings/builder.json
'
,
oldFireUuid
,
newFireUuid
);
const
newJsUuid
=
v4
();
const
newJsUuid
=
v4
();
const
newJsShortUuid
=
getShortUuid
(
newJsUuid
);
const
newJsShortUuid
=
getShortUuid
(
newJsUuid
);
const
newJsId
=
v4
().
replace
(
/-/g
,
''
).
substring
(
0
,
oldJsId
.
length
);
const
newJsId
=
v4
().
replace
(
/-/g
,
''
).
substring
(
0
,
oldJsId
.
length
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.ts.meta`
,
oldJsUuid
,
newJsUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.ts.meta`
,
oldJsUuid
,
newJsUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.js.meta`
,
oldJsUuid
,
newJsUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.js.meta`
,
oldJsUuid
,
newJsUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire`
,
oldFireUuid
,
newFireUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire`
,
oldFireUuid
,
newFireUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire`
,
oldJsShortUuid
,
newJsShortUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire`
,
oldJsShortUuid
,
newJsShortUuid
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire`
,
oldJsId
,
newJsId
);
fileReplace
(
`assets/
${
folderName
}
/scene/
${
folderName
}
.fire`
,
oldJsId
,
newJsId
);
console
.
log
(
'
build_step_0 完成~!
'
);
console
.
log
(
'
build_step_0 完成~!
'
);
}
}
function
replaceIndexHtml
()
{
function
replaceIndexHtml
()
{
const
data
=
fs
.
readFileSync
(
'
index.html
'
);
const
data
=
fs
.
readFileSync
(
'
index.html
'
);
fs
.
writeFileSync
(
'
dist/play/index.html
'
,
data
);
fs
.
writeFileSync
(
'
dist/play/index.html
'
,
data
);
}
}
module
.
exports
=
{
module
.
exports
=
{
build
:
async
function
()
{
build
:
async
function
()
{
const
startTime
=
new
Date
().
getTime
();
const
startTime
=
new
Date
().
getTime
();
// 构建前检查
const
projectName
=
build_check
();
// 构建前检查
const
projectName
=
build_check
();
// 清理旧文件
// 清理旧文件
// 构建form
await
removeDir
(
'
dist/form
'
);
// 构建form
await
buildForm
();
await
removeDir
(
'
dist/form
'
);
await
buildForm
();
// 替换uuid
replaceUuids
();
// 替换uuid
replaceUuids
();
// 改设置为非bundle
changeSettingToWebDesktop
();
// 改设置为非bundle
changeSettingToWebDesktop
();
// 构建play
await
removeDir
(
'
dist/play
'
);
// 构建play
await
buildWebDesktop
();
await
removeDir
(
'
dist/play
'
);
await
copyDir
(
'
build/web-desktop
'
,
'
dist/play
'
);
await
buildWebDesktop
();
replaceIndexHtml
();
await
copyDir
(
'
build/web-desktop
'
,
'
dist/play
'
);
console
.
log
(
'
构建 web desktop 成功!
'
);
replaceIndexHtml
();
console
.
log
(
'
构建 web desktop 成功!
'
);
// 改设置为bundle
changeSettingsToBundle
();
// 改设置为bundle
changeSettingsToBundle
();
await
removeDir
(
'
dist/android
'
);
await
buildAndroidBundle
();
await
removeDir
(
'
dist/android
'
);
await
copyDir
(
'
build_android/jsb-link/remote
'
,
'
dist/android
'
);
await
buildAndroidBundle
();
console
.
log
(
'
构建 android bundle 成功!
'
);
await
copyDir
(
'
build_android/jsb-link/remote
'
,
'
dist/android
'
);
console
.
log
(
'
构建 android bundle 成功!
'
);
await
removeDir
(
'
dist/ios
'
);
await
buildIosBundle
();
await
removeDir
(
'
dist/ios
'
);
await
copyDir
(
'
build_ios/jsb-link/remote
'
,
'
dist/ios
'
);
await
buildIosBundle
();
console
.
log
(
'
构建 ios bundle 成功!
'
);
await
copyDir
(
'
build_ios/jsb-link/remote
'
,
'
dist/ios
'
);
console
.
log
(
'
构建 ios bundle 成功!
'
);
await
removeDir
(
'
dist/web_desktop
'
);
await
buildWebBundle
();
await
removeDir
(
'
dist/web_desktop
'
);
await
copyDir
(
`build_web_desktop/web-desktop/assets/
${
projectName
}
`
,
'
dist/web_desktop
'
);
await
buildWebBundle
();
console
.
log
(
'
构建 web bundle 成功!
'
);
await
copyDir
(
`build_web_desktop/web-desktop/assets/
${
projectName
}
`
,
'
dist/web_desktop
'
);
console
.
log
(
'
构建 web bundle 成功!
'
);
// 改设置为非bundle
changeSettingToWebDesktop
();
// 改设置为非bundle
changeSettingToWebDesktop
();
createConfigFile
(
projectName
);
createConfigFile
(
projectName
);
compressAll
(
projectName
);
compressAll
(
projectName
);
await
removeDir
(
'
build
'
);
await
removeDir
(
'
build_android
'
);
await
removeDir
(
'
build
'
);
await
removeDir
(
'
build_ios
'
);
await
removeDir
(
'
build_android
'
);
await
removeDir
(
'
build_web_desktop
'
);
await
removeDir
(
'
build_ios
'
);
await
removeDir
(
'
build_web_desktop
'
);
const
endTime
=
new
Date
().
getTime
();
const
duration
=
new
Date
(
endTime
-
startTime
);
const
endTime
=
new
Date
().
getTime
();
console
.
log
(
`打包完成!`
);
const
duration
=
new
Date
(
endTime
-
startTime
);
console
.
log
(
`用时
${
duration
.
getMinutes
()}
分
${
duration
.
getSeconds
()}
秒。`
);
console
.
log
(
`打包完成!`
);
},
console
.
log
(
`用时
${
duration
.
getMinutes
()}
分
${
duration
.
getSeconds
()}
秒。`
);
},
buildAndroid
:
async
function
()
{
// 构建前检查
buildAndroid
:
async
function
()
{
const
projectName
=
build_check
();
// 替换uuid
// 构建前检查
replaceUuids
();
const
projectName
=
build_check
();
// 改设置为bundle
// 替换uuid
changeSettingsToBundle
();
replaceUuids
();
// 改设置为bundle
await
removeDir
(
'
dist/android
'
);
changeSettingsToBundle
();
await
buildAndroidBundle
();
await
copyDir
(
'
build_android/jsb-link/remote
'
,
'
dist/android
'
);
await
removeDir
(
'
dist/android
'
);
await
buildAndroidBundle
();
// 改设置为非bundle
await
copyDir
(
'
build_android/jsb-link/remote
'
,
'
dist/android
'
);
changeSettingToWebDesktop
();
createConfigFile
(
projectName
,
'
android
'
);
// 改设置为非bundle
await
removeDir
(
'
build_android
'
);
changeSettingToWebDesktop
();
console
.
log
(
'
构建 android bundle 成功!
'
);
createConfigFile
(
projectName
,
"
android
"
);
},
await
removeDir
(
'
build_android
'
);
console
.
log
(
'
构建 android bundle 成功!
'
);
buildIos
:
async
function
()
{
},
// 构建前检查
const
projectName
=
build_check
();
buildIos
:
async
function
()
{
// 替换uuid
replaceUuids
();
// 构建前检查
// 改设置为bundle
const
projectName
=
build_check
();
changeSettingsToBundle
();
// 替换uuid
replaceUuids
();
await
removeDir
(
'
dist/ios
'
);
// 改设置为bundle
await
buildIosBundle
();
changeSettingsToBundle
();
await
copyDir
(
'
build_ios/jsb-link/remote
'
,
'
dist/ios
'
);
await
removeDir
(
'
dist/ios
'
);
// 改设置为非bundle
await
buildIosBundle
();
changeSettingToWebDesktop
();
await
copyDir
(
'
build_ios/jsb-link/remote
'
,
'
dist/ios
'
);
createConfigFile
(
projectName
,
'
ios
'
);
await
removeDir
(
'
build_ios
'
);
// 改设置为非bundle
console
.
log
(
'
构建 ios bundle 成功!
'
);
changeSettingToWebDesktop
();
},
createConfigFile
(
projectName
,
"
ios
"
);
await
removeDir
(
'
build_ios
'
);
console
.
log
(
'
构建 ios bundle 成功!
'
);
}
};
};
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