Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NS02
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
NS02
Commits
5cb77a3c
Commit
5cb77a3c
authored
Dec 27, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
dec51142
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1042 additions
and
437 deletions
+1042
-437
NS02.meta
assets/NS02.meta
+1
-15
NS02.fire
assets/NS02/scene/NS02.fire
+580
-259
NS02.ts
assets/NS02/scene/NS02.ts
+25
-39
NS02.ts.meta
assets/NS02/scene/NS02.ts.meta
+1
-1
NS022.ts
assets/NS02/scene/NS022.ts
+303
-0
NS022.ts.meta
assets/NS02/scene/NS022.ts.meta
+9
-0
audo_ani.ts
assets/NS02/scene/audo_ani.ts
+0
-10
audo_ani.ts.meta
assets/NS02/scene/audo_ani.ts.meta
+1
-1
chess.ts
assets/NS02/scene/chess.ts
+0
-4
hand_ani.ts
assets/NS02/scene/hand_ani.ts
+13
-6
map.ts
assets/NS02/scene/map.ts
+2
-1
pg.ts
assets/NS02/scene/pg.ts
+3
-2
player.ts
assets/NS02/scene/player.ts
+2
-2
speak.ts
assets/NS02/scene/speak.ts
+32
-31
start.ts
assets/NS02/scene/start.ts
+16
-16
touzi.ts
assets/NS02/scene/touzi.ts
+5
-4
MyCocosSceneComponent.ts
assets/NS02/script/MyCocosSceneComponent.ts
+6
-6
util.ts
assets/NS02/script/util.ts
+1
-1
buildCocos.js
bin/buildCocos.js
+34
-34
builder.json
settings/builder.json
+7
-4
project.json
settings/project.json
+1
-1
No files found.
assets/NS02.meta
View file @
5cb77a3c
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
{"ver":"1.1.2","uuid":"c35bb2f6-f24a-4850-ae44-643f2fdc7541","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
assets/NS02/scene/NS02.fire
View file @
5cb77a3c
...
...
@@ -75,43 +75,43 @@
"__id__": 5
},
{
"__id__": 2
1
"__id__": 2
7
},
{
"__id__": 2
3
"__id__": 2
9
},
{
"__id__":
26
"__id__":
32
},
{
"__id__":
28
"__id__":
34
},
{
"__id__":
64
"__id__":
70
},
{
"__id__":
76
"__id__":
82
},
{
"__id__": 11
0
"__id__": 11
6
},
{
"__id__": 1
26
"__id__": 1
32
},
{
"__id__": 13
2
"__id__": 13
8
}
],
"_active": true,
"_components": [
{
"__id__": 1
47
"__id__": 1
53
},
{
"__id__": 1
48
"__id__": 1
54
},
{
"__id__": 1
49
"__id__": 1
55
}
],
"_prefab": null,
...
...
@@ -270,6 +270,12 @@
"_children": [
{
"__id__": 6
},
{
"__id__": 21
},
{
"__id__": 24
}
],
"_active": true,
...
...
@@ -969,6 +975,321 @@
"preload": false,
"_id": "9c00bG8ndKapYjv7UaV/kz"
},
{
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_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": "f5nh00nj5NuIH4fR3vWu/O"
},
{
"__type__": "cc.Node",
"_name": "BRLNSDB",
"_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": 50.4
},
"_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": "77rvTJQUFJGqhTBLqPlVrr"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_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": "1eN2+tNFxOlLBKpKwZGEjp"
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [
{
"__id__": 25
}
],
"_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": "c8DiRwGXRKCbTNrO23KYmQ"
},
{
"__type__": "cc.Node",
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 815,
"height": 488
},
"_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": "c2RbblMz1H7LpBvi0m0T4e"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "677e271f-5c8c-407a-b434-6c13aa1ab8d0"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "faFj+r6S5OeaUt1AQjKPr7"
},
{
"__type__": "cc.Node",
"_name": "btn_return",
...
...
@@ -980,7 +1301,7 @@
"_active": false,
"_components": [
{
"__id__": 2
2
"__id__": 2
8
}
],
"_prefab": null,
...
...
@@ -1036,7 +1357,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
1
"__id__": 2
7
},
"_enabled": true,
"_materials": [
...
...
@@ -1074,10 +1395,10 @@
"_active": true,
"_components": [
{
"__id__":
24
"__id__":
30
},
{
"__id__":
25
"__id__":
31
}
],
"_prefab": null,
...
...
@@ -1133,7 +1454,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
3
"__id__": 2
9
},
"_enabled": true,
"_materials": [
...
...
@@ -1165,7 +1486,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
3
"__id__": 2
9
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1198,7 +1519,7 @@
"_active": true,
"_components": [
{
"__id__":
27
"__id__":
33
}
],
"_prefab": null,
...
...
@@ -1254,7 +1575,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
26
"__id__":
32
},
"_enabled": true,
"_materials": [
...
...
@@ -1290,16 +1611,16 @@
},
"_children": [
{
"__id__":
29
"__id__":
35
},
{
"__id__":
46
"__id__":
52
}
],
"_active": true,
"_components": [
{
"__id__": 6
3
"__id__": 6
9
}
],
"_prefab": null,
...
...
@@ -1355,14 +1676,14 @@
"_name": "player",
"_objFlags": 0,
"_parent": {
"__id__":
28
"__id__":
34
},
"_children": [
{
"__id__": 3
0
"__id__": 3
6
},
{
"__id__": 3
2
"__id__": 3
8
}
],
"_active": true,
...
...
@@ -1420,13 +1741,13 @@
"_name": "icon_player",
"_objFlags": 0,
"_parent": {
"__id__":
29
"__id__":
35
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
1
"__id__": 3
7
}
],
"_prefab": null,
...
...
@@ -1482,7 +1803,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
0
"__id__": 3
6
},
"_enabled": true,
"_materials": [
...
...
@@ -1514,32 +1835,32 @@
"_name": "icon_player_dice",
"_objFlags": 0,
"_parent": {
"__id__":
29
"__id__":
35
},
"_children": [
{
"__id__": 3
3
"__id__": 3
9
},
{
"__id__":
35
"__id__":
41
},
{
"__id__":
37
"__id__":
43
},
{
"__id__":
39
"__id__":
45
},
{
"__id__": 4
1
"__id__": 4
7
},
{
"__id__": 4
3
"__id__": 4
9
}
],
"_active":
fals
e,
"_active":
tru
e,
"_components": [
{
"__id__":
45
"__id__":
51
}
],
"_prefab": null,
...
...
@@ -1595,13 +1916,13 @@
"_name": "icon_6",
"_objFlags": 0,
"_parent": {
"__id__": 3
2
"__id__": 3
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
34
"__id__":
40
}
],
"_prefab": null,
...
...
@@ -1657,7 +1978,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
3
"__id__": 3
9
},
"_enabled": true,
"_materials": [
...
...
@@ -1689,13 +2010,13 @@
"_name": "icon_4",
"_objFlags": 0,
"_parent": {
"__id__": 3
2
"__id__": 3
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
36
"__id__":
42
}
],
"_prefab": null,
...
...
@@ -1751,7 +2072,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
35
"__id__":
41
},
"_enabled": true,
"_materials": [
...
...
@@ -1783,13 +2104,13 @@
"_name": "icon_5",
"_objFlags": 0,
"_parent": {
"__id__": 3
2
"__id__": 3
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
38
"__id__":
44
}
],
"_prefab": null,
...
...
@@ -1845,7 +2166,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
37
"__id__":
43
},
"_enabled": true,
"_materials": [
...
...
@@ -1877,13 +2198,13 @@
"_name": "icon_3",
"_objFlags": 0,
"_parent": {
"__id__": 3
2
"__id__": 3
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
0
"__id__": 4
6
}
],
"_prefab": null,
...
...
@@ -1909,8 +2230,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-0.168
,
13
2.039
,
0
,
13
1.65
,
0,
0,
0,
...
...
@@ -1932,14 +2253,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "
dcEkykorhOsJNpTmB4cgYp
"
"_id": "
13l6a4sAdLJ4G/jG3FIqia
"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
39
"__id__":
45
},
"_enabled": true,
"_materials": [
...
...
@@ -1964,20 +2285,20 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "
edZWvegLZOELWkWYunnbZW
"
"_id": "
adKF/t3YNIEb10kfC5k4X8
"
},
{
"__type__": "cc.Node",
"_name": "icon_2",
"_objFlags": 0,
"_parent": {
"__id__": 3
2
"__id__": 3
8
},
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 4
2
"__id__": 4
8
}
],
"_prefab": null,
...
...
@@ -2033,7 +2354,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
1
"__id__": 4
7
},
"_enabled": true,
"_materials": [
...
...
@@ -2065,13 +2386,13 @@
"_name": "icon_1",
"_objFlags": 0,
"_parent": {
"__id__": 3
2
"__id__": 3
8
},
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__":
44
"__id__":
50
}
],
"_prefab": null,
...
...
@@ -2127,7 +2448,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
3
"__id__": 4
9
},
"_enabled": true,
"_materials": [
...
...
@@ -2159,7 +2480,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
2
"__id__": 3
8
},
"_enabled": true,
"_materials": [
...
...
@@ -2191,14 +2512,14 @@
"_name": "robot",
"_objFlags": 0,
"_parent": {
"__id__":
28
"__id__":
34
},
"_children": [
{
"__id__":
47
"__id__":
53
},
{
"__id__":
49
"__id__":
55
}
],
"_active": true,
...
...
@@ -2256,13 +2577,13 @@
"_name": "icon_robot",
"_objFlags": 0,
"_parent": {
"__id__":
46
"__id__":
52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
48
"__id__":
54
}
],
"_prefab": null,
...
...
@@ -2318,7 +2639,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
47
"__id__":
53
},
"_enabled": true,
"_materials": [
...
...
@@ -2350,32 +2671,32 @@
"_name": "icon_robot_dice",
"_objFlags": 0,
"_parent": {
"__id__":
46
"__id__":
52
},
"_children": [
{
"__id__": 5
0
"__id__": 5
6
},
{
"__id__": 5
2
"__id__": 5
8
},
{
"__id__":
54
"__id__":
60
},
{
"__id__":
56
"__id__":
62
},
{
"__id__":
58
"__id__":
64
},
{
"__id__": 6
0
"__id__": 6
6
}
],
"_active": false,
"_components": [
{
"__id__": 6
2
"__id__": 6
8
}
],
"_prefab": null,
...
...
@@ -2431,13 +2752,13 @@
"_name": "icon_6",
"_objFlags": 0,
"_parent": {
"__id__":
49
"__id__":
55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 5
1
"__id__": 5
7
}
],
"_prefab": null,
...
...
@@ -2493,7 +2814,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
0
"__id__": 5
6
},
"_enabled": true,
"_materials": [
...
...
@@ -2525,13 +2846,13 @@
"_name": "icon_4",
"_objFlags": 0,
"_parent": {
"__id__":
49
"__id__":
55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 5
3
"__id__": 5
9
}
],
"_prefab": null,
...
...
@@ -2587,7 +2908,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
2
"__id__": 5
8
},
"_enabled": true,
"_materials": [
...
...
@@ -2619,13 +2940,13 @@
"_name": "icon_5",
"_objFlags": 0,
"_parent": {
"__id__":
49
"__id__":
55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
55
"__id__":
61
}
],
"_prefab": null,
...
...
@@ -2681,7 +3002,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
54
"__id__":
60
},
"_enabled": true,
"_materials": [
...
...
@@ -2713,13 +3034,13 @@
"_name": "icon_3",
"_objFlags": 0,
"_parent": {
"__id__":
49
"__id__":
55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
57
"__id__":
63
}
],
"_prefab": null,
...
...
@@ -2775,7 +3096,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
56
"__id__":
62
},
"_enabled": true,
"_materials": [
...
...
@@ -2807,13 +3128,13 @@
"_name": "icon_2",
"_objFlags": 0,
"_parent": {
"__id__":
49
"__id__":
55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
59
"__id__":
65
}
],
"_prefab": null,
...
...
@@ -2869,7 +3190,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
58
"__id__":
64
},
"_enabled": true,
"_materials": [
...
...
@@ -2901,13 +3222,13 @@
"_name": "icon_1",
"_objFlags": 0,
"_parent": {
"__id__":
49
"__id__":
55
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
1
"__id__": 6
7
}
],
"_prefab": null,
...
...
@@ -2963,7 +3284,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
0
"__id__": 6
6
},
"_enabled": true,
"_materials": [
...
...
@@ -2995,7 +3316,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
49
"__id__":
55
},
"_enabled": true,
"_materials": [
...
...
@@ -3027,7 +3348,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
28
"__id__":
34
},
"_enabled": true,
"label": null,
...
...
@@ -3043,16 +3364,16 @@
},
"_children": [
{
"__id__":
65
"__id__":
71
},
{
"__id__": 7
0
"__id__": 7
6
}
],
"_active": true,
"_components": [
{
"__id__":
75
"__id__":
81
}
],
"_prefab": null,
...
...
@@ -3108,20 +3429,20 @@
"_name": "chess_player",
"_objFlags": 0,
"_parent": {
"__id__":
64
"__id__":
70
},
"_children": [
{
"__id__":
66
"__id__":
72
}
],
"_active": true,
"_components": [
{
"__id__":
68
"__id__":
74
},
{
"__id__":
69
"__id__":
75
}
],
"_prefab": null,
...
...
@@ -3177,13 +3498,13 @@
"_name": "star",
"_objFlags": 0,
"_parent": {
"__id__":
65
"__id__":
71
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
67
"__id__":
73
}
],
"_prefab": null,
...
...
@@ -3239,7 +3560,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
66
"__id__":
72
},
"_enabled": true,
"_clip": {
...
...
@@ -3258,7 +3579,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
65
"__id__":
71
},
"_enabled": true,
"_materials": [
...
...
@@ -3290,7 +3611,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
65
"__id__":
71
},
"_enabled": true,
"isRobot": false,
...
...
@@ -3301,20 +3622,20 @@
"_name": "chess_robot",
"_objFlags": 0,
"_parent": {
"__id__":
64
"__id__":
70
},
"_children": [
{
"__id__": 7
1
"__id__": 7
7
}
],
"_active": true,
"_components": [
{
"__id__": 7
3
"__id__": 7
9
},
{
"__id__":
74
"__id__":
80
}
],
"_prefab": null,
...
...
@@ -3370,13 +3691,13 @@
"_name": "star",
"_objFlags": 0,
"_parent": {
"__id__": 7
0
"__id__": 7
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
2
"__id__": 7
8
}
],
"_prefab": null,
...
...
@@ -3432,7 +3753,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
1
"__id__": 7
7
},
"_enabled": true,
"_clip": {
...
...
@@ -3451,7 +3772,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
0
"__id__": 7
6
},
"_enabled": true,
"_materials": [
...
...
@@ -3483,7 +3804,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
0
"__id__": 7
6
},
"_enabled": true,
"isRobot": true,
...
...
@@ -3494,7 +3815,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
64
"__id__":
70
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -3525,19 +3846,19 @@
},
"_children": [
{
"__id__":
77
"__id__":
83
},
{
"__id__": 10
3
"__id__": 10
9
},
{
"__id__": 1
06
"__id__": 1
12
}
],
"_active": false,
"_components": [
{
"__id__": 1
09
"__id__": 1
15
}
],
"_prefab": null,
...
...
@@ -3593,18 +3914,9 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__":
76
"__id__":
82
},
"_children": [
{
"__id__": 78
},
{
"__id__": 80
},
{
"__id__": 82
},
{
"__id__": 84
},
...
...
@@ -3631,12 +3943,21 @@
},
{
"__id__": 100
},
{
"__id__": 102
},
{
"__id__": 104
},
{
"__id__": 106
}
],
"_active": true,
"_components": [
{
"__id__": 10
2
"__id__": 10
8
}
],
"_prefab": null,
...
...
@@ -3692,13 +4013,13 @@
"_name": "bg_1",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
79
"__id__":
85
}
],
"_prefab": null,
...
...
@@ -3754,7 +4075,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
78
"__id__":
84
},
"_enabled": true,
"_materials": [
...
...
@@ -3786,13 +4107,13 @@
"_name": "bg_2",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 8
1
"__id__": 8
7
}
],
"_prefab": null,
...
...
@@ -3848,7 +4169,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
0
"__id__": 8
6
},
"_enabled": true,
"_materials": [
...
...
@@ -3880,13 +4201,13 @@
"_name": "bg_3",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 8
3
"__id__": 8
9
}
],
"_prefab": null,
...
...
@@ -3942,7 +4263,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
2
"__id__": 8
8
},
"_enabled": true,
"_materials": [
...
...
@@ -3974,13 +4295,13 @@
"_name": "bg_4",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
85
"__id__":
91
}
],
"_prefab": null,
...
...
@@ -4036,7 +4357,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
84
"__id__":
90
},
"_enabled": true,
"_materials": [
...
...
@@ -4068,13 +4389,13 @@
"_name": "bg_5",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
87
"__id__":
93
}
],
"_prefab": null,
...
...
@@ -4130,7 +4451,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
86
"__id__":
92
},
"_enabled": true,
"_materials": [
...
...
@@ -4162,13 +4483,13 @@
"_name": "bg_6",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
89
"__id__":
95
}
],
"_prefab": null,
...
...
@@ -4224,7 +4545,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
88
"__id__":
94
},
"_enabled": true,
"_materials": [
...
...
@@ -4256,13 +4577,13 @@
"_name": "bg_dice3",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 9
1
"__id__": 9
7
}
],
"_prefab": null,
...
...
@@ -4318,7 +4639,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
0
"__id__": 9
6
},
"_enabled": true,
"_materials": [
...
...
@@ -4350,13 +4671,13 @@
"_name": "bg_dice2",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 9
3
"__id__": 9
9
}
],
"_prefab": null,
...
...
@@ -4412,7 +4733,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
2
"__id__": 9
8
},
"_enabled": true,
"_materials": [
...
...
@@ -4444,13 +4765,13 @@
"_name": "bg_dice1",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
95
"__id__":
101
}
],
"_prefab": null,
...
...
@@ -4506,7 +4827,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
94
"__id__":
100
},
"_enabled": true,
"_materials": [
...
...
@@ -4538,13 +4859,13 @@
"_name": "bg_dice5",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
97
"__id__":
103
}
],
"_prefab": null,
...
...
@@ -4600,7 +4921,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
96
"__id__":
102
},
"_enabled": true,
"_materials": [
...
...
@@ -4632,13 +4953,13 @@
"_name": "bg_dice4",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
99
"__id__":
105
}
],
"_prefab": null,
...
...
@@ -4694,7 +5015,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
98
"__id__":
104
},
"_enabled": true,
"_materials": [
...
...
@@ -4726,13 +5047,13 @@
"_name": "bg_dice6",
"_objFlags": 0,
"_parent": {
"__id__":
77
"__id__":
83
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 10
1
"__id__": 10
7
}
],
"_prefab": null,
...
...
@@ -4788,7 +5109,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
0
"__id__": 10
6
},
"_enabled": true,
"_materials": [
...
...
@@ -4820,7 +5141,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
77
"__id__":
83
},
"_enabled": true,
"label": null,
...
...
@@ -4832,16 +5153,16 @@
"_name": "btn_stop",
"_objFlags": 0,
"_parent": {
"__id__":
76
"__id__":
82
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
04
"__id__": 1
10
},
{
"__id__": 1
05
"__id__": 1
11
}
],
"_prefab": null,
...
...
@@ -4897,7 +5218,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
3
"__id__": 10
9
},
"_enabled": true,
"_materials": [
...
...
@@ -4929,7 +5250,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
3
"__id__": 10
9
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -4990,7 +5311,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 10
3
"__id__": 10
9
},
"_id": "6btfsmisBFibMp9UnkII+V"
},
...
...
@@ -4999,16 +5320,16 @@
"_name": "hand",
"_objFlags": 0,
"_parent": {
"__id__":
76
"__id__":
82
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
07
"__id__": 1
13
},
{
"__id__": 1
08
"__id__": 1
14
}
],
"_prefab": null,
...
...
@@ -5064,7 +5385,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
06
"__id__": 1
12
},
"_enabled": true,
"_materials": [
...
...
@@ -5096,7 +5417,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
06
"__id__": 1
12
},
"_enabled": true,
"label": null,
...
...
@@ -5108,7 +5429,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
76
"__id__":
82
},
"_enabled": true,
"_materials": [
...
...
@@ -5144,31 +5465,31 @@
},
"_children": [
{
"__id__": 11
1
"__id__": 11
7
},
{
"__id__": 11
3
"__id__": 11
9
},
{
"__id__": 1
16
"__id__": 1
22
},
{
"__id__": 1
18
"__id__": 1
24
},
{
"__id__": 12
0
"__id__": 12
6
},
{
"__id__": 12
2
"__id__": 12
8
}
],
"_active": true,
"_components": [
{
"__id__": 1
24
"__id__": 1
30
},
{
"__id__": 1
25
"__id__": 1
31
}
],
"_prefab": null,
...
...
@@ -5224,13 +5545,13 @@
"_name": "text_tip",
"_objFlags": 0,
"_parent": {
"__id__": 11
0
"__id__": 11
6
},
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 11
2
"__id__": 11
8
}
],
"_prefab": null,
...
...
@@ -5286,7 +5607,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
1
"__id__": 11
7
},
"_enabled": true,
"_materials": [
...
...
@@ -5318,16 +5639,16 @@
"_name": "btn_audio_start",
"_objFlags": 0,
"_parent": {
"__id__": 11
0
"__id__": 11
6
},
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 1
14
"__id__": 1
20
},
{
"__id__": 1
15
"__id__": 1
21
}
],
"_prefab": null,
...
...
@@ -5383,7 +5704,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
3
"__id__": 11
9
},
"_enabled": true,
"_materials": [
...
...
@@ -5415,7 +5736,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
3
"__id__": 11
9
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -5483,13 +5804,13 @@
"_name": "btn_audio_stop",
"_objFlags": 0,
"_parent": {
"__id__": 11
0
"__id__": 11
6
},
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 1
17
"__id__": 1
23
}
],
"_prefab": null,
...
...
@@ -5545,7 +5866,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
16
"__id__": 1
22
},
"_enabled": true,
"_materials": [
...
...
@@ -5577,13 +5898,13 @@
"_name": "speak_ske",
"_objFlags": 0,
"_parent": {
"__id__": 11
0
"__id__": 11
6
},
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 1
19
"__id__": 1
25
}
],
"_prefab": null,
...
...
@@ -5639,7 +5960,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
18
"__id__": 1
24
},
"_enabled": true,
"_materials": [
...
...
@@ -5679,13 +6000,13 @@
"_name": "bg_goodjob",
"_objFlags": 0,
"_parent": {
"__id__": 11
0
"__id__": 11
6
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 12
1
"__id__": 12
7
}
],
"_prefab": null,
...
...
@@ -5741,7 +6062,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
0
"__id__": 12
6
},
"_enabled": true,
"_materials": [
...
...
@@ -5773,13 +6094,13 @@
"_name": "bg_tryagain",
"_objFlags": 0,
"_parent": {
"__id__": 11
0
"__id__": 11
6
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 12
3
"__id__": 12
9
}
],
"_prefab": null,
...
...
@@ -5835,7 +6156,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
2
"__id__": 12
8
},
"_enabled": true,
"_materials": [
...
...
@@ -5867,7 +6188,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
0
"__id__": 11
6
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -5894,7 +6215,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
0
"__id__": 11
6
},
"_enabled": true,
"label": null,
...
...
@@ -5910,16 +6231,16 @@
},
"_children": [
{
"__id__": 1
27
"__id__": 1
33
},
{
"__id__": 1
29
"__id__": 1
35
}
],
"_active": true,
"_components": [
{
"__id__": 13
1
"__id__": 13
7
}
],
"_prefab": null,
...
...
@@ -5975,13 +6296,13 @@
"_name": "bg_win",
"_objFlags": 0,
"_parent": {
"__id__": 1
26
"__id__": 1
32
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
28
"__id__": 1
34
}
],
"_prefab": null,
...
...
@@ -6037,7 +6358,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
27
"__id__": 1
33
},
"_enabled": true,
"_materials": [
...
...
@@ -6069,13 +6390,13 @@
"_name": "bg_lose",
"_objFlags": 0,
"_parent": {
"__id__": 1
26
"__id__": 1
32
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 13
0
"__id__": 13
6
}
],
"_prefab": null,
...
...
@@ -6131,7 +6452,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
29
"__id__": 1
35
},
"_enabled": true,
"_materials": [
...
...
@@ -6163,7 +6484,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
26
"__id__": 1
32
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -6194,25 +6515,25 @@
},
"_children": [
{
"__id__": 13
3
"__id__": 13
9
},
{
"__id__": 1
36
"__id__": 1
42
},
{
"__id__": 1
39
"__id__": 1
45
},
{
"__id__": 14
2
"__id__": 14
8
}
],
"_active": true,
"_components": [
{
"__id__": 1
45
"__id__": 1
51
},
{
"__id__": 1
46
"__id__": 1
52
}
],
"_prefab": null,
...
...
@@ -6268,16 +6589,16 @@
"_name": "panel_gray",
"_objFlags": 0,
"_parent": {
"__id__": 13
2
"__id__": 13
8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
34
"__id__": 1
40
},
{
"__id__": 1
35
"__id__": 1
41
}
],
"_prefab": null,
...
...
@@ -6333,7 +6654,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
3
"__id__": 13
9
},
"_enabled": true,
"_materials": [
...
...
@@ -6365,7 +6686,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
3
"__id__": 13
9
},
"_enabled": true,
"_id": "e4yCZbisZBGZqMqHEXBseL"
...
...
@@ -6375,16 +6696,16 @@
"_name": "btn_start",
"_objFlags": 0,
"_parent": {
"__id__": 13
2
"__id__": 13
8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
37
"__id__": 1
43
},
{
"__id__": 1
38
"__id__": 1
44
}
],
"_prefab": null,
...
...
@@ -6440,7 +6761,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
36
"__id__": 1
42
},
"_enabled": true,
"_materials": [
...
...
@@ -6472,7 +6793,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
36
"__id__": 1
42
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -6533,7 +6854,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 1
36
"__id__": 1
42
},
"_id": "57btGK5ftHapBJVGaJiIv5"
},
...
...
@@ -6542,16 +6863,16 @@
"_name": "btn_restart",
"_objFlags": 0,
"_parent": {
"__id__": 13
2
"__id__": 13
8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 14
0
"__id__": 14
6
},
{
"__id__": 14
1
"__id__": 14
7
}
],
"_prefab": null,
...
...
@@ -6607,7 +6928,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
39
"__id__": 1
45
},
"_enabled": true,
"_materials": [
...
...
@@ -6639,7 +6960,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
39
"__id__": 1
45
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -6700,7 +7021,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 1
39
"__id__": 1
45
},
"_id": "b3sVKz5e1PN4fADR0phF4M"
},
...
...
@@ -6709,16 +7030,16 @@
"_name": "bg_vs",
"_objFlags": 0,
"_parent": {
"__id__": 13
2
"__id__": 13
8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 14
3
"__id__": 14
9
},
{
"__id__": 1
44
"__id__": 1
50
}
],
"_prefab": null,
...
...
@@ -6774,7 +7095,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
2
"__id__": 14
8
},
"_enabled": true,
"_materials": [
...
...
@@ -6806,7 +7127,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
2
"__id__": 14
8
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -6833,7 +7154,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
2
"__id__": 13
8
},
"_enabled": true,
"label": null,
...
...
@@ -6845,7 +7166,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
2
"__id__": 13
8
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -6912,13 +7233,13 @@
"_id": "0dy9tHRJNBYq2rl91tk65I"
},
{
"__type__": "
408a6f4ZfpM8Yzyg+IOGg/V
",
"__type__": "
70918kKQJdMdLOI4L5Tj5wc
",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "
863D556WtLbqdZNSjTfHFT
"
"_id": "
bdHDCGTxRCQZU1gSyCtIXb
"
}
]
\ No newline at end of file
assets/NS02/scene/NS02.ts
View file @
5cb77a3c
...
...
@@ -4,33 +4,37 @@ import pg from "./pg";
import
map
from
"
./map
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
enum
CELLTYPE
{
SPEAK
=
1
,
MOVE_ADD
=
2
,
ROLL_AGAIN
=
3
,
DELAY_TIME
=
4
,
JUMP_ROLL
=
5
,
WIN
=
100
,
const
CELLTYPE
=
{
SPEAK
:
1
,
MOVE_ADD
:
2
,
ROLL_AGAIN
:
3
,
DELAY_TIME
:
4
,
JUMP_ROLL
:
5
,
WIN
:
100
,
}
@
ccclass
export
default
class
SceneComponent
extends
MyCocosSceneComponent
{
export
default
class
NewClass
extends
MyCocosSceneComponent
{
addPreloadImage
()
{
this
.
log
(
"
test addPreloadImage
"
)
// TODO 根据自己的配置预加载图片资源
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url
});
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url_2
});
this
.
data
&&
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url
});
this
.
data
&&
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url_2
});
}
addPreloadAudio
()
{
this
.
log
(
"
test addPreloadAudio
"
)
// TODO 根据自己的配置预加载音频资源
this
.
_audioResList
.
push
({
url
:
this
.
data
.
audio_url
});
this
.
data
&&
this
.
_audioResList
.
push
({
url
:
this
.
data
.
audio_url
});
}
addPreloadAnima
()
{
this
.
log
(
"
test addPreloadAnima
"
)
}
onLoadEnd
()
{
this
.
log
(
"
test onLoadEnd
"
)
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this
.
initData
();
this
.
initView
();
...
...
@@ -39,35 +43,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
_cantouch
=
null
;
initData
()
{
this
.
log
(
"
test initData
"
)
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
}
//开发流程
//1.start状态
//2.开局效果
//3.骰子动效,stop效果。
//4.星星位移。
//--游戏开始就计算好后续的所有点数数组。
//--骰子及位移点数等添加到一个数组中,每次需要获取当前点和目标点时进行实时获取。
//--出现错误反向退回。
//--位移停止后触发目的地内容。
//5.触发目的地道具效果。
//--如各类道具,进行分类。统一调用一个方法输入,给予id
//--如:终点。可触发终点效果。
//--如:语音。触发语音效果。
//--如:加速。触发位移效果。
//6.语音录音部分。
//--动画组件,start end。
//7.机器人骰子及自动进程。
//--机器人难度处理,游戏开始就计算好后续的所有点数数组。
//--调用通用的内容进行位移。
//8.结算胜负
//9.重新开始
initView
()
{
this
.
log
(
"
test initView
"
)
this
.
initTouzi
();
this
.
initChess
();
}
initEvent
()
{
this
.
log
(
"
test initEvent
"
)
pg
.
event
.
on
(
"
game_start
"
,
()
=>
{
this
.
onGameStart
()
})
pg
.
event
.
on
(
"
speak_success
"
,
()
=>
{
this
.
onSpeakScueess
()
});
...
...
@@ -245,16 +231,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
touzi
=
icon
.
getComponent
(
"
touzi
"
);
let
hand
=
pg
.
view
.
find
(
touzi_ani
,
"
hand
"
);
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
btn_stop
.
active
=
false
;
pg
.
view
.
visible
(
btn_stop
,
false
)
;
this
.
lastPointId
=
this
.
playerPoint
+
1
;
if
(
!
runNum
)
{
runNum
=
1
+
Math
.
floor
(
Math
.
random
()
*
6
);
if
(
this
.
turnRobot
)
runNum
=
1
+
Math
.
floor
(
Math
.
random
()
*
5
);
}
hand
.
active
=
false
;
pg
.
view
.
visible
(
hand
,
false
)
;
clearTimeout
(
this
.
stopHandTimer
);
touzi
.
stopAni
(
runNum
).
then
(()
=>
{
touzi_ani
.
active
=
false
;
pg
.
view
.
visible
(
touzi_ani
,
false
)
;
pg
.
event
.
emit
(
"
player_point_update
"
,
{
isRobot
:
this
.
turnRobot
,
num
:
runNum
});
this
.
moveChess
(
runNum
).
then
(()
=>
{
this
.
checkCell
();
...
...
@@ -269,8 +255,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
touzi
=
icon
.
getComponent
(
"
touzi
"
);
let
hand
=
pg
.
view
.
find
(
touzi_ani
,
"
hand
"
);
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
btn_stop
.
active
=
true
;
touzi_ani
.
active
=
true
;
pg
.
view
.
visible
(
btn_stop
,
true
)
;
pg
.
view
.
visible
(
touzi_ani
,
true
)
;
touzi
.
startAni
();
if
(
this
.
turnRobot
)
{
setTimeout
(()
=>
{
...
...
@@ -278,7 +264,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
},
300
+
Math
.
random
()
*
200
);
}
else
{
this
.
stopHandTimer
=
setTimeout
(()
=>
{
hand
.
active
=
true
;
pg
.
view
.
visible
(
hand
,
true
)
;
},
5000
);
}
pg
.
hw
.
playLocalAudio
(
"
touzi
"
,
true
).
then
((
id
:
number
)
=>
{
...
...
assets/NS02/scene/NS02.ts.meta
View file @
5cb77a3c
{
"ver": "1.0.8",
"uuid": "
408a67f8-65fa-4cf1-8cf2-83e20e1a0fd5
",
"uuid": "
7091890a-4097-4c74-b388-e0be538f9c1c
",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
assets/NS02/scene/NS022.ts
0 → 100644
View file @
5cb77a3c
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
import
pg
from
"
./pg
"
;
import
map
from
"
./map
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
const
CELLTYPE
=
{
SPEAK
:
1
,
MOVE_ADD
:
2
,
ROLL_AGAIN
:
3
,
DELAY_TIME
:
4
,
JUMP_ROLL
:
5
,
WIN
:
100
,
}
@
ccclass
export
default
class
SceneComponent
extends
MyCocosSceneComponent
{
addPreloadImage
()
{
this
.
log
(
"
test addPreloadImage
"
)
// TODO 根据自己的配置预加载图片资源
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url
});
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url_2
});
}
addPreloadAudio
()
{
this
.
log
(
"
test addPreloadAudio
"
)
// TODO 根据自己的配置预加载音频资源
this
.
_audioResList
.
push
({
url
:
this
.
data
.
audio_url
});
}
addPreloadAnima
()
{
this
.
log
(
"
test addPreloadAnima
"
)
}
onLoadEnd
()
{
this
.
log
(
"
test onLoadEnd
"
)
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this
.
initData
();
this
.
initView
();
this
.
initEvent
();
}
_cantouch
=
null
;
initData
()
{
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
}
initView
()
{
this
.
initTouzi
();
this
.
initChess
();
}
initEvent
()
{
pg
.
event
.
on
(
"
game_start
"
,
()
=>
{
this
.
onGameStart
()
})
pg
.
event
.
on
(
"
speak_success
"
,
()
=>
{
this
.
onSpeakScueess
()
});
pg
.
event
.
on
(
"
speak_fail
"
,
()
=>
{
this
.
onSpeakFail
()
});
}
//-----------------------------流程------------------------------
private
playerPoint
:
number
;
//
private
robotPoint
:
number
;
//
private
turnRobot
:
boolean
;
//当前是谁操作
onGameStart
()
{
this
.
playerPoint
=
0
;
this
.
robotPoint
=
0
;
this
.
turnRobot
=
Math
.
random
()
<
0.5
;
this
.
initChess
();
setTimeout
(()
=>
{
this
.
startTouzi
();
},
2100
);
}
onSpeakScueess
()
{
//执行后续的动作。
this
.
turnNext
();
}
onSpeakFail
()
{
//回退到最后一个位置
let
cell
=
map
[
this
.
playerPoint
];
this
.
jumpChess
(
cell
,
this
.
lastPointId
).
then
(()
=>
{
this
.
turnNext
();
})
}
turnNext
()
{
this
.
turnRobot
=
!
this
.
turnRobot
;
this
.
startTouzi
();
}
//-----------------------------CHESS-------------------------------
private
chessPlayer
:
cc
.
Node
;
private
chessRobot
:
cc
.
Node
;
initChess
()
{
//初始化棋子
this
.
chessPlayer
=
pg
.
view
.
find
(
this
,
"
chess/chess_player
"
);
this
.
chessRobot
=
pg
.
view
.
find
(
this
,
"
chess/chess_robot
"
);
let
point
=
map
[
0
];
this
.
chessPlayer
.
x
=
Number
(
point
.
yellow_x
);
this
.
chessPlayer
.
y
=
Number
(
point
.
yellow_y
);
this
.
chessRobot
.
x
=
Number
(
point
.
blue_x
);
this
.
chessRobot
.
y
=
Number
(
point
.
blue_y
);
}
getMovePoints
(
now
,
runNum
)
{
let
points
=
[];
for
(
let
i
=
now
;
i
<=
now
+
runNum
;
i
++
)
{
let
point
=
map
[
i
];
if
(
!
point
)
break
;
points
.
push
(
point
);
}
return
points
;
}
moveChess
(
runNum
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
runNum
=
runNum
;
if
(
this
.
turnRobot
)
{
let
points
=
this
.
getMovePoints
(
this
.
robotPoint
,
runNum
);
console
.
log
(
points
);
this
.
chessRobot
.
getComponent
(
"
chess
"
).
run
(
points
).
then
(()
=>
{
this
.
robotPoint
+=
(
points
.
length
-
1
);
resolve
(
''
);
})
}
else
{
let
points
=
this
.
getMovePoints
(
this
.
playerPoint
,
runNum
);
console
.
log
(
points
);
this
.
chessPlayer
.
getComponent
(
"
chess
"
).
run
(
points
).
then
(()
=>
{
this
.
playerPoint
+=
(
points
.
length
-
1
);
resolve
(
''
);
})
}
});
}
jumpChess
(
cell
,
jumpId
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
jumpCell
=
map
[
jumpId
-
1
];
let
points
=
[
cell
,
jumpCell
];
if
(
this
.
turnRobot
)
{
this
.
chessRobot
.
getComponent
(
"
chess
"
).
run
(
points
).
then
(()
=>
{
this
.
robotPoint
=
Number
(
jumpCell
.
id
)
-
1
;
resolve
(
''
);
})
}
else
{
this
.
chessPlayer
.
getComponent
(
"
chess
"
).
run
(
points
).
then
(()
=>
{
this
.
playerPoint
=
Number
(
jumpCell
.
id
)
-
1
;
resolve
(
''
);
})
}
});
}
private
runNum
:
number
;
checkCell
()
{
if
(
this
.
turnRobot
)
{
let
cell
=
map
[
this
.
robotPoint
];
let
val
=
cell
.
value
;
let
type
=
Number
(
cell
.
type
);
switch
(
type
)
{
case
CELLTYPE
.
MOVE_ADD
:
this
.
moveChess
(
Number
(
val
)).
then
(()
=>
{
this
.
checkCell
();
})
break
;
case
CELLTYPE
.
ROLL_AGAIN
:
this
.
turnRobot
=
!
this
.
turnRobot
;
this
.
turnNext
();
break
;
case
CELLTYPE
.
JUMP_ROLL
:
this
.
jumpChess
(
cell
,
Number
(
val
)).
then
(()
=>
{
this
.
checkCell
();
})
break
;
case
CELLTYPE
.
WIN
:
this
.
gameOver
();
break
;
default
:
this
.
turnNext
();
break
;
}
return
}
setTimeout
(()
=>
{
let
cell
=
map
[
this
.
playerPoint
];
let
val
=
cell
.
value
;
let
type
=
Number
(
cell
.
type
);
switch
(
type
)
{
case
CELLTYPE
.
SPEAK
:
pg
.
event
.
emit
(
"
speak_open
"
,
cell
)
break
;
case
CELLTYPE
.
DELAY_TIME
:
setTimeout
(()
=>
{
this
.
turnNext
();
},
5000
);
break
;
case
CELLTYPE
.
MOVE_ADD
:
this
.
moveChess
(
Number
(
val
)).
then
(()
=>
{
this
.
checkCell
();
})
break
;
case
CELLTYPE
.
ROLL_AGAIN
:
this
.
turnRobot
=
!
this
.
turnRobot
;
this
.
turnNext
();
break
;
case
CELLTYPE
.
JUMP_ROLL
:
this
.
jumpChess
(
cell
,
Number
(
val
)).
then
(()
=>
{
this
.
checkCell
();
})
break
;
case
CELLTYPE
.
WIN
:
this
.
gameOver
();
break
;
default
:
this
.
turnNext
();
break
;
}
},
100
);
}
//-----------------------------TOUZI-------------------------------
initTouzi
()
{
let
touzi_ani
=
pg
.
view
.
find
(
this
,
"
touzi_ani
"
);
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
pg
.
view
.
touchOn
(
btn_stop
,
this
.
onTouchStop
,
this
);
}
onTouchStop
()
{
if
(
this
.
turnRobot
)
return
;
this
.
stopTouzi
();
}
lastPointId
:
number
;
stopTouzi
(
runNum
=
0
)
{
pg
.
audio
.
stopAudio
(
this
.
touziAudio
);
let
touzi_ani
=
pg
.
view
.
find
(
this
,
"
touzi_ani
"
);
let
icon
=
pg
.
view
.
find
(
touzi_ani
,
"
icon
"
);
let
touzi
=
icon
.
getComponent
(
"
touzi
"
);
let
hand
=
pg
.
view
.
find
(
touzi_ani
,
"
hand
"
);
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
pg
.
view
.
visible
(
btn_stop
,
false
);
this
.
lastPointId
=
this
.
playerPoint
+
1
;
if
(
!
runNum
)
{
runNum
=
1
+
Math
.
floor
(
Math
.
random
()
*
6
);
if
(
this
.
turnRobot
)
runNum
=
1
+
Math
.
floor
(
Math
.
random
()
*
5
);
}
pg
.
view
.
visible
(
hand
,
false
);
clearTimeout
(
this
.
stopHandTimer
);
touzi
.
stopAni
(
runNum
).
then
(()
=>
{
pg
.
view
.
visible
(
touzi_ani
,
false
);
pg
.
event
.
emit
(
"
player_point_update
"
,
{
isRobot
:
this
.
turnRobot
,
num
:
runNum
});
this
.
moveChess
(
runNum
).
then
(()
=>
{
this
.
checkCell
();
})
})
}
private
stopHandTimer
:
number
;
private
touziAudio
:
number
;
startTouzi
()
{
let
touzi_ani
=
pg
.
view
.
find
(
this
,
"
touzi_ani
"
);
let
icon
=
pg
.
view
.
find
(
touzi_ani
,
"
icon
"
);
let
touzi
=
icon
.
getComponent
(
"
touzi
"
);
let
hand
=
pg
.
view
.
find
(
touzi_ani
,
"
hand
"
);
let
btn_stop
=
pg
.
view
.
find
(
touzi_ani
,
"
btn_stop
"
);
pg
.
view
.
visible
(
btn_stop
,
true
);
pg
.
view
.
visible
(
touzi_ani
,
true
);
touzi
.
startAni
();
if
(
this
.
turnRobot
)
{
setTimeout
(()
=>
{
this
.
stopTouzi
();
},
300
+
Math
.
random
()
*
200
);
}
else
{
this
.
stopHandTimer
=
setTimeout
(()
=>
{
pg
.
view
.
visible
(
hand
,
true
);
},
5000
);
}
pg
.
hw
.
playLocalAudio
(
"
touzi
"
,
true
).
then
((
id
:
number
)
=>
{
this
.
touziAudio
=
id
;
})
}
//----------------------------OVER-------------------
gameOver
()
{
let
state
=
pg
.
view
.
find
(
this
,
"
state
"
);
let
bg_win
=
pg
.
view
.
find
(
state
,
"
bg_win
"
);
let
bg_lose
=
pg
.
view
.
find
(
state
,
"
bg_lose
"
);
pg
.
view
.
visible
(
state
,
true
);
if
(
this
.
playerPoint
>
this
.
robotPoint
)
{
pg
.
view
.
visible
(
bg_win
,
true
);
pg
.
view
.
visible
(
bg_lose
,
false
);
pg
.
hw
.
playLocalAudio
(
"
flower
"
);
}
else
{
pg
.
view
.
visible
(
bg_win
,
false
);
pg
.
view
.
visible
(
bg_lose
,
true
);
}
setTimeout
(()
=>
{
pg
.
view
.
visible
(
bg_win
,
false
);
pg
.
view
.
visible
(
bg_lose
,
false
);
pg
.
event
.
emit
(
"
game_over
"
);
},
5000
);
// onHomeworkFinish最后需要添加作业完成
onHomeworkFinish
();
}
//-----------------------------TOOL-------------------------------
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/NS02/scene/NS022.ts.meta
0 → 100644
View file @
5cb77a3c
{
"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/NS02/scene/audo_ani.ts
View file @
5cb77a3c
...
...
@@ -23,21 +23,11 @@ export default class NewClass extends cc.Component {
this
.
count
=
0
;
}
start
()
{
}
update
(
dt
)
{
this
.
count
++
;
// if (this.count >= 30) this.count = 0;
this
.
updateItems
();
}
updateItems
()
{
let
cur
=
Math
.
floor
(
this
.
count
/
30
)
%
4
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
let
item
=
pg
.
view
.
find
(
this
,
"
btn_audio
"
+
i
);
item
.
active
=
cur
==
i
;
}
}
}
assets/NS02/scene/audo_ani.ts.meta
View file @
5cb77a3c
{
"ver": "1.0.8",
"uuid": "
bed01784-8114-4d5e-bd26-36345307676c
",
"uuid": "
764039ec-62e7-416b-a01b-1f8dd451a870
",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
assets/NS02/scene/chess.ts
View file @
5cb77a3c
...
...
@@ -59,9 +59,5 @@ export default class NewClass extends cc.Component {
});
return
posArray
;
}
start
()
{
}
// update (dt) {}
}
assets/NS02/scene/hand_ani.ts
View file @
5cb77a3c
...
...
@@ -22,12 +22,19 @@ export default class NewClass extends cc.Component {
this
.
showAni
();
}
showAni
()
{
this
.
node
.
x
+=
400
;
this
.
node
.
y
-=
200
;
cc
.
tween
(
this
.
node
).
by
(
0.3
,
{
x
:
-
400
,
y
:
200
}).
start
();
setTimeout
(()
=>
{
this
.
showAni
();
},
2000
);
if
(
this
.
node
&&
this
.
node
.
active
)
{
this
.
node
.
x
+=
400
;
this
.
node
.
y
-=
200
;
cc
.
tween
(
this
.
node
).
by
(
0.3
,
{
x
:
-
400
,
y
:
200
}).
call
(()
=>
{
setTimeout
(()
=>
{
this
.
showAni
();
},
1500
);
}).
start
();
}
else
{
setTimeout
(()
=>
{
this
.
showAni
();
},
100
);
}
}
update
(
dt
)
{
...
...
assets/NS02/scene/map.ts
View file @
5cb77a3c
export
default
[
{
"
id
"
:
"
1
"
,
"
yellow_x
"
:
"
-480
"
,
"
yellow_y
"
:
"
70
"
,
"
blue_x
"
:
"
-345
"
,
"
blue_y
"
:
"
70
"
,
"
type
"
:
"
0
"
,
"
value
"
:
"
0
"
},
{
"
id
"
:
"
2
"
,
"
yellow_x
"
:
"
-480
"
,
"
yellow_y
"
:
"
290
"
,
"
blue_x
"
:
"
-345
"
,
"
blue_y
"
:
"
135
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
3
"
,
"
yellow_x
"
:
"
-270
"
,
"
yellow_y
"
:
"
290
"
,
"
blue_x
"
:
"
-270
"
,
"
blue_y
"
:
"
135
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
4
"
,
"
yellow_x
"
:
"
-130
"
,
"
yellow_y
"
:
"
290
"
,
"
blue_x
"
:
"
-130
"
,
"
blue_y
"
:
"
135
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
5
"
,
"
yellow_x
"
:
"
-10
"
,
"
yellow_y
"
:
"
290
"
,
"
blue_x
"
:
"
-10
"
,
"
blue_y
"
:
"
135
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
2
"
},
{
"
id
"
:
"
6
"
,
"
yellow_x
"
:
"
150
"
,
"
yellow_y
"
:
"
290
"
,
"
blue_x
"
:
"
150
"
,
"
blue_y
"
:
"
135
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
7
"
,
"
yellow_x
"
:
"
300
"
,
"
yellow_y
"
:
"
290
"
,
"
blue_x
"
:
"
300
"
,
"
blue_y
"
:
"
135
"
,
"
type
"
:
"
5
"
,
"
value
"
:
"
14
"
},
{
"
id
"
:
"
8
"
,
"
yellow_x
"
:
"
500
"
,
"
yellow_y
"
:
"
290
"
,
"
blue_x
"
:
"
370
"
,
"
blue_y
"
:
"
135
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
9
"
,
"
yellow_x
"
:
"
500
"
,
"
yellow_y
"
:
"
70
"
,
"
blue_x
"
:
"
370
"
,
"
blue_y
"
:
"
70
"
,
"
type
"
:
"
3
"
,
"
value
"
:
"
1
"
},
{
"
id
"
:
"
10
"
,
"
yellow_x
"
:
"
500
"
,
"
yellow_y
"
:
"
-70
"
,
"
blue_x
"
:
"
370
"
,
"
blue_y
"
:
"
-70
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
11
"
,
"
yellow_x
"
:
"
500
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
370
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
12
"
,
"
yellow_x
"
:
"
290
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
290
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
13
"
,
"
yellow_x
"
:
"
150
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
150
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
3
"
},
{
"
id
"
:
"
14
"
,
"
yellow_x
"
:
"
10
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
10
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
15
"
,
"
yellow_x
"
:
"
-130
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
-130
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
1
"
},
{
"
id
"
:
"
16
"
,
"
yellow_x
"
:
"
-270
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
-270
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
17
"
,
"
yellow_x
"
:
"
-410
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
-410
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
4
"
,
"
value
"
:
"
5
"
},
{
"
id
"
:
"
18
"
,
"
yellow_x
"
:
"
-550
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
-550
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
19
"
,
"
yellow_x
"
:
"
-775
"
,
"
yellow_y
"
:
"
-280
"
,
"
blue_x
"
:
"
-600
"
,
"
blue_y
"
:
"
-125
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
20
"
,
"
yellow_x
"
:
"
-775
"
,
"
yellow_y
"
:
"
-55
"
,
"
blue_x
"
:
"
-600
"
,
"
blue_y
"
:
"
-55
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
21
"
,
"
yellow_x
"
:
"
-775
"
,
"
yellow_y
"
:
"
80
"
,
"
blue_x
"
:
"
-600
"
,
"
blue_y
"
:
"
80
"
,
"
type
"
:
"
4
"
,
"
value
"
:
"
5
"
},
{
"
id
"
:
"
22
"
,
"
yellow_x
"
:
"
-775
"
,
"
yellow_y
"
:
"
220
"
,
"
blue_x
"
:
"
-600
"
,
"
blue_y
"
:
"
220
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
3
"
},
{
"
id
"
:
"
23
"
,
"
yellow_x
"
:
"
-775
"
,
"
yellow_y
"
:
"
365
"
,
"
blue_x
"
:
"
-600
"
,
"
blue_y
"
:
"
365
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
24
"
,
"
yellow_x
"
:
"
-775
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
-600
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
5
"
},
{
"
id
"
:
"
25
"
,
"
yellow_x
"
:
"
-550
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
-550
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
26
"
,
"
yellow_x
"
:
"
-410
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
-410
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
4
"
,
"
value
"
:
"
5
"
},
{
"
id
"
:
"
27
"
,
"
yellow_x
"
:
"
-270
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
-270
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
2
"
},
{
"
id
"
:
"
28
"
,
"
yellow_x
"
:
"
-130
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
-130
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
29
"
,
"
yellow_x
"
:
"
10
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
10
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
30
"
,
"
yellow_x
"
:
"
150
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
150
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
3
"
,
"
value
"
:
"
1
"
},
{
"
id
"
:
"
31
"
,
"
yellow_x
"
:
"
290
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
290
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
32
"
,
"
yellow_x
"
:
"
430
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
430
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
1
"
},
{
"
id
"
:
"
33
"
,
"
yellow_x
"
:
"
570
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
570
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
4
"
,
"
value
"
:
"
5
"
},
{
"
id
"
:
"
34
"
,
"
yellow_x
"
:
"
790
"
,
"
yellow_y
"
:
"
550
"
,
"
blue_x
"
:
"
630
"
,
"
blue_y
"
:
"
420
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
35
"
,
"
yellow_x
"
:
"
790
"
,
"
yellow_y
"
:
"
360
"
,
"
blue_x
"
:
"
630
"
,
"
blue_y
"
:
"
360
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
36
"
,
"
yellow_x
"
:
"
790
"
,
"
yellow_y
"
:
"
215
"
,
"
blue_x
"
:
"
630
"
,
"
blue_y
"
:
"
215
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
3
"
},
{
"
id
"
:
"
37
"
,
"
yellow_x
"
:
"
790
"
,
"
yellow_y
"
:
"
70
"
,
"
blue_x
"
:
"
630
"
,
"
blue_y
"
:
"
70
"
,
"
type
"
:
"
5
"
,
"
value
"
:
"
43
"
},
{
"
id
"
:
"
38
"
,
"
yellow_x
"
:
"
790
"
,
"
yellow_y
"
:
"
-75
"
,
"
blue_x
"
:
"
630
"
,
"
blue_y
"
:
"
-75
"
,
"
type
"
:
"
3
"
,
"
value
"
:
"
1
"
},
{
"
id
"
:
"
39
"
,
"
yellow_x
"
:
"
790
"
,
"
yellow_y
"
:
"
-220
"
,
"
blue_x
"
:
"
630
"
,
"
blue_y
"
:
"
-220
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
40
"
,
"
yellow_x
"
:
"
790
"
,
"
yellow_y
"
:
"
-365
"
,
"
blue_x
"
:
"
630
"
,
"
blue_y
"
:
"
-365
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
1
"
},
{
"
id
"
:
"
41
"
,
"
yellow_x
"
:
"
790
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
630
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
42
"
,
"
yellow_x
"
:
"
570
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
570
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
43
"
,
"
yellow_x
"
:
"
430
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
430
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
2
"
},
{
"
id
"
:
"
44
"
,
"
yellow_x
"
:
"
290
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
290
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
45
"
,
"
yellow_x
"
:
"
150
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
150
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
4
"
,
"
value
"
:
"
5
"
},
{
"
id
"
:
"
46
"
,
"
yellow_x
"
:
"
10
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
10
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
47
"
,
"
yellow_x
"
:
"
-130
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
-130
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
window
"
},
{
"
id
"
:
"
48
"
,
"
yellow_x
"
:
"
-270
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
-270
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
door
"
},
{
"
id
"
:
"
49
"
,
"
yellow_x
"
:
"
-410
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
-410
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
2
"
,
"
value
"
:
"
2
"
},
{
"
id
"
:
"
50
"
,
"
yellow_x
"
:
"
-550
"
,
"
yellow_y
"
:
"
-550
"
,
"
blue_x
"
:
"
-550
"
,
"
blue_y
"
:
"
-405
"
,
"
type
"
:
"
1
"
,
"
value
"
:
"
blackboard
"
},
{
"
id
"
:
"
51
"
,
"
yellow_x
"
:
"
-690
"
,
"
yellow_y
"
:
"
-490
"
,
"
blue_x
"
:
"
-690
"
,
"
blue_y
"
:
"
-490
"
,
"
type
"
:
"
100
"
,
"
value
"
:
"
0
"
}]
\ No newline at end of file
{
"
id
"
:
"
51
"
,
"
yellow_x
"
:
"
-690
"
,
"
yellow_y
"
:
"
-490
"
,
"
blue_x
"
:
"
-690
"
,
"
blue_y
"
:
"
-490
"
,
"
type
"
:
"
100
"
,
"
value
"
:
"
0
"
}
]
\ No newline at end of file
assets/NS02/scene/pg.ts
View file @
5cb77a3c
...
...
@@ -14,7 +14,8 @@ class Emitter {
return
this
;
}
on
(
event
,
fn
)
{
(
this
.
_callbacks
[
event
]
=
this
.
_callbacks
[
event
]
||
[]).
push
(
fn
);
if
(
!
this
.
_callbacks
[
event
])
this
.
_callbacks
[
event
]
=
[];
this
.
_callbacks
[
event
].
push
(
fn
);
};
once
(
event
,
fn
)
{
function
on
()
{
...
...
@@ -208,7 +209,7 @@ let pg = {
if
(
!
item
)
return
pg
.
logger
.
w
(
"
图片更换失败,传入了错误的item
"
);
let
node
=
item
.
node
?
item
.
node
:
item
;
if
(
!
res
)
{
node
.
active
=
false
;
if
(
node
)
node
.
active
=
false
;
return
pg
.
logger
.
w
(
"
图片更换失败,传入了错误的res
"
);
}
if
(
!
node
)
return
pg
.
logger
.
w
(
"
图片更换失败,传入了错误的item
"
);
...
...
assets/NS02/scene/player.ts
View file @
5cb77a3c
...
...
@@ -31,7 +31,7 @@ export default class NewClass extends cc.Component {
pg
.
view
.
visible
(
icon_player_dice
,
true
);
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
let
item
=
pg
.
view
.
find
(
icon_player_dice
,
"
icon_
"
+
i
);
item
.
active
=
i
==
num
;
pg
.
view
.
visible
(
item
,
i
==
num
)
;
}
}
else
{
let
icon_player
=
pg
.
view
.
find
(
this
.
player
,
"
icon_player
"
);
...
...
@@ -48,7 +48,7 @@ export default class NewClass extends cc.Component {
pg
.
view
.
visible
(
icon_robot_dice
,
true
);
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
let
item
=
pg
.
view
.
find
(
icon_robot_dice
,
"
icon_
"
+
i
);
item
.
active
=
i
==
num
;
pg
.
view
.
visible
(
item
,
i
==
num
)
;
}
}
else
{
let
icon_robot
=
pg
.
view
.
find
(
this
.
robot
,
"
icon_robot
"
);
...
...
assets/NS02/scene/speak.ts
View file @
5cb77a3c
...
...
@@ -33,18 +33,19 @@ export default class NewClass extends cc.Component {
this
.
bg_goodjob
=
pg
.
view
.
find
(
this
,
"
bg_goodjob
"
);
this
.
bg_tryagain
=
pg
.
view
.
find
(
this
,
"
bg_tryagain
"
);
this
.
text_tip
.
active
=
false
;
this
.
btn_audio_start
.
active
=
false
;
this
.
btn_audio_stop
.
active
=
false
;
this
.
speak_ske
.
active
=
false
;
this
.
bg_goodjob
.
active
=
false
;
this
.
bg_tryagain
.
active
=
false
;
pg
.
view
.
visible
(
this
.
text_tip
,
false
)
;
pg
.
view
.
visible
(
this
.
btn_audio_start
,
false
)
;
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
)
;
pg
.
view
.
visible
(
this
.
speak_ske
,
false
)
;
pg
.
view
.
visible
(
this
.
bg_goodjob
,
false
)
;
pg
.
view
.
visible
(
this
.
bg_tryagain
,
false
)
;
pg
.
view
.
touchOn
(
this
.
btn_audio_start
,
this
.
onTouchStart
,
this
);
pg
.
view
.
touchOn
(
this
.
btn_audio_stop
,
this
.
onTouchStop
,
this
);
this
.
tryCount
=
0
;
pg
.
event
.
on
(
"
speak_open
"
,
(
data
)
=>
{
cc
.
log
(
"
speak_open
"
);
this
.
tryCount
=
0
;
this
.
open
(
data
)
})
...
...
@@ -56,33 +57,33 @@ export default class NewClass extends cc.Component {
if
(
cell
)
{
this
.
val
=
cell
.
value
;
}
this
.
text_tip
.
active
=
true
;
this
.
btn_audio_start
.
active
=
true
;
this
.
btn_audio_stop
.
active
=
false
;
this
.
speak_ske
.
active
=
true
;
this
.
bg_goodjob
.
active
=
false
;
this
.
bg_tryagain
.
active
=
false
;
pg
.
view
.
visible
(
this
.
text_tip
,
true
)
;
pg
.
view
.
visible
(
this
.
btn_audio_start
,
true
)
;
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
)
;
pg
.
view
.
visible
(
this
.
speak_ske
,
true
)
;
pg
.
view
.
visible
(
this
.
bg_goodjob
,
false
)
;
pg
.
view
.
visible
(
this
.
bg_tryagain
,
false
)
;
}
close
()
{
this
.
text_tip
.
active
=
false
;
this
.
btn_audio_start
.
active
=
false
;
this
.
btn_audio_stop
.
active
=
false
;
this
.
speak_ske
.
active
=
false
;
this
.
bg_goodjob
.
active
=
false
;
this
.
bg_tryagain
.
active
=
false
;
pg
.
view
.
visible
(
this
.
text_tip
,
false
)
;
pg
.
view
.
visible
(
this
.
btn_audio_start
,
false
)
;
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
)
;
pg
.
view
.
visible
(
this
.
speak_ske
,
false
)
;
pg
.
view
.
visible
(
this
.
bg_goodjob
,
false
)
;
pg
.
view
.
visible
(
this
.
bg_tryagain
,
false
)
;
}
onTouchStart
()
{
pg
.
view
.
playDBAnimation
(
this
.
speak_ske
,
"
newAnimation
"
,
0
);
this
.
btn_audio_start
.
active
=
false
;
this
.
btn_audio_stop
.
active
=
true
;
pg
.
view
.
visible
(
this
.
btn_audio_start
,
false
)
;
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
true
)
;
let
win
:
any
=
window
;
win
.
courseware
&&
win
.
courseware
.
startTest
(
this
.
val
);
//开始录音
}
onTouchStop
()
{
this
.
btn_audio_start
.
active
=
false
;
this
.
btn_audio_stop
.
active
=
false
;
pg
.
view
.
visible
(
this
.
btn_audio_start
,
false
)
;
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
)
;
let
win
:
any
=
window
;
if
(
!
win
.
courseware
)
{
setTimeout
(()
=>
{
...
...
@@ -118,25 +119,25 @@ export default class NewClass extends cc.Component {
}
onRealStop
(
score
)
{
pg
.
view
.
playDBAnimation
(
this
.
speak_ske
,
"
newAnimation
"
,
1
);
this
.
text_tip
.
active
=
false
;
this
.
btn_audio_start
.
active
=
false
;
this
.
btn_audio_stop
.
active
=
false
;
this
.
speak_ske
.
active
=
false
;
this
.
bg_goodjob
.
active
=
false
;
this
.
bg_tryagain
.
active
=
false
;
pg
.
view
.
visible
(
this
.
text_tip
,
false
)
;
pg
.
view
.
visible
(
this
.
btn_audio_start
,
false
)
;
pg
.
view
.
visible
(
this
.
btn_audio_stop
,
false
)
;
pg
.
view
.
visible
(
this
.
speak_ske
,
false
)
;
pg
.
view
.
visible
(
this
.
bg_goodjob
,
false
)
;
pg
.
view
.
visible
(
this
.
bg_tryagain
,
false
)
;
setTimeout
(()
=>
{
// let score = Math.random() * 100 - 50;
pg
.
hw
.
playLocalAudio
(
"
goodjob
"
);
if
(
score
>
50
)
{
this
.
bg_goodjob
.
active
=
true
;
pg
.
view
.
visible
(
this
.
bg_goodjob
,
true
)
;
setTimeout
(()
=>
{
this
.
close
();
pg
.
event
.
emit
(
"
speak_success
"
);
},
2000
);
}
else
{
if
(
this
.
tryCount
>=
1
)
{
this
.
bg_tryagain
.
active
=
true
;
pg
.
view
.
visible
(
this
.
bg_tryagain
,
true
)
;
pg
.
hw
.
playLocalAudio
(
"
tryagain
"
);
this
.
tryCount
++
;
//需要处理提供两次机会。重置一次到open状态
...
...
@@ -146,7 +147,7 @@ export default class NewClass extends cc.Component {
},
2000
);
}
else
{
this
.
bg_tryagain
.
active
=
true
;
pg
.
view
.
visible
(
this
.
bg_tryagain
,
true
)
;
pg
.
hw
.
playLocalAudio
(
"
tryagain
"
);
this
.
tryCount
++
;
setTimeout
(()
=>
{
...
...
assets/NS02/scene/start.ts
View file @
5cb77a3c
...
...
@@ -30,8 +30,8 @@ export default class NewClass extends cc.Component {
let
btn_start
=
pg
.
view
.
find
(
this
,
"
btn_start
"
);
let
btn_restart
=
pg
.
view
.
find
(
this
,
"
btn_restart
"
);
let
bg_vs
=
pg
.
view
.
find
(
this
,
"
bg_vs
"
);
p
anel_gray
.
active
=
true
;
btn_start
.
active
=
true
;
p
g
.
view
.
visible
(
panel_gray
,
true
)
;
pg
.
view
.
visible
(
btn_start
,
true
)
;
}
onTouchStart
()
{
pg
.
hw
.
playLocalAudio
(
"
vs
"
);
...
...
@@ -39,13 +39,13 @@ export default class NewClass extends cc.Component {
let
btn_start
=
pg
.
view
.
find
(
this
,
"
btn_start
"
);
let
btn_restart
=
pg
.
view
.
find
(
this
,
"
btn_restart
"
);
let
bg_vs
=
pg
.
view
.
find
(
this
,
"
bg_vs
"
);
p
anel_gray
.
active
=
true
;
btn_start
.
active
=
false
;
bg_vs
.
active
=
true
;
p
g
.
view
.
visible
(
panel_gray
,
true
)
;
pg
.
view
.
visible
(
btn_start
,
false
)
;
pg
.
view
.
visible
(
bg_vs
,
true
)
;
pg
.
event
.
emit
(
"
game_start
"
);
setTimeout
(()
=>
{
bg_vs
.
active
=
false
;
p
anel_gray
.
active
=
false
;
pg
.
view
.
visible
(
bg_vs
,
false
)
;
p
g
.
view
.
visible
(
panel_gray
,
false
)
;
},
2000
);
}
onTouchRestart
()
{
...
...
@@ -54,14 +54,14 @@ export default class NewClass extends cc.Component {
let
btn_start
=
pg
.
view
.
find
(
this
,
"
btn_start
"
);
let
btn_restart
=
pg
.
view
.
find
(
this
,
"
btn_restart
"
);
let
bg_vs
=
pg
.
view
.
find
(
this
,
"
bg_vs
"
);
p
anel_gray
.
active
=
true
;
btn_start
.
active
=
false
;
btn_restart
.
active
=
false
;
bg_vs
.
active
=
true
;
p
g
.
view
.
visible
(
panel_gray
,
true
)
;
pg
.
view
.
visible
(
btn_start
,
false
)
;
pg
.
view
.
visible
(
btn_restart
,
false
)
;
pg
.
view
.
visible
(
bg_vs
,
true
)
;
setTimeout
(()
=>
{
bg_vs
.
active
=
false
;
p
anel_gray
.
active
=
false
;
btn_restart
.
active
=
false
;
pg
.
view
.
visible
(
bg_vs
,
false
)
;
p
g
.
view
.
visible
(
panel_gray
,
false
)
;
pg
.
view
.
visible
(
btn_restart
,
false
)
;
pg
.
event
.
emit
(
"
game_start
"
);
},
2000
);
}
...
...
@@ -69,8 +69,8 @@ export default class NewClass extends cc.Component {
let
panel_gray
=
pg
.
view
.
find
(
this
,
"
panel_gray
"
);
let
btn_restart
=
pg
.
view
.
find
(
this
,
"
btn_restart
"
);
let
bg_vs
=
pg
.
view
.
find
(
this
,
"
bg_vs
"
);
p
anel_gray
.
active
=
true
;
btn_restart
.
active
=
true
;
p
g
.
view
.
visible
(
panel_gray
,
true
)
;
pg
.
view
.
visible
(
btn_restart
,
true
)
;
}
update
(
dt
)
{
}
}
assets/NS02/scene/touzi.ts
View file @
5cb77a3c
...
...
@@ -67,21 +67,22 @@ export default class NewClass extends cc.Component {
if
(
!
number
)
return
;
if
(
this
.
num
)
{
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
this
[
`bg_
${
i
}
`
].
active
=
false
;
pg
.
view
.
visible
(
this
[
`bg_
${
i
}
`
],
false
)
}
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
this
[
`bg_dice
${
i
}
`
].
active
=
i
==
number
;
pg
.
view
.
visible
(
this
[
`bg_dice
${
i
}
`
],
i
==
number
)
}
}
else
{
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
this
[
`bg_
${
i
}
`
].
active
=
i
==
number
;
pg
.
view
.
visible
(
this
[
`bg_
${
i
}
`
],
i
==
number
)
}
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
this
[
`bg_dice
${
i
}
`
].
active
=
false
;
pg
.
view
.
visible
(
this
[
`bg_dice
${
i
}
`
],
false
)
}
}
}
update
(
dt
)
{
if
(
!
this
.
node
||
!
this
.
node
.
active
)
return
;
if
(
this
.
playing
)
{
let
i
=
Math
.
floor
(
Math
.
random
()
*
6
)
+
1
;
this
.
updatePoint
(
i
);
...
...
assets/NS02/script/MyCocosSceneComponent.ts
View file @
5cb77a3c
...
...
@@ -105,17 +105,17 @@ export class MyCocosSceneComponent extends cc.Component {
});
}
log
(
str
)
{
log
(
str
)
{
const
node
=
cc
.
find
(
'
middleLayer
'
);
if
(
node
)
{
if
(
node
)
{
node
.
getComponent
(
'
middleLayer
'
).
log
(
str
);
}
else
{
}
else
{
cc
.
log
(
str
);
}
}
onLoadEnd
()
{
}
...
...
@@ -132,7 +132,7 @@ export class MyCocosSceneComponent extends cc.Component {
// ------------------------------------------------
getSprNode
(
resName
)
{
const
sf
=
cc
.
find
(
'
Canvas/res/img/
'
+
resName
).
getComponent
(
cc
.
Sprite
).
spriteFrame
;
...
...
@@ -164,7 +164,7 @@ export class MyCocosSceneComponent extends cc.Component {
playAudioByUrl
(
audio_url
,
cb
=
null
)
{
if
(
audio_url
)
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
)
=>
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
:
any
)
=>
{
const
audioId
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
0.8
);
if
(
cb
)
{
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
...
...
assets/NS02/script/util.ts
View file @
5cb77a3c
...
...
@@ -102,7 +102,7 @@ export function getDistance (start, end){
export
function
playAudioByUrl
(
audio_url
,
cb
=
null
)
{
if
(
audio_url
)
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
)
=>
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
:
any
)
=>
{
const
audioId
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
0.8
);
if
(
cb
)
{
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
...
...
bin/buildCocos.js
View file @
5cb77a3c
const
{
spawn
}
=
require
(
"
child_process
"
);
const
fs
=
require
(
"
fs
"
);
const
compressing
=
require
(
'
compressing
'
);
const
{
v4
,
parse
}
=
require
(
'
uuid
'
);
const
{
Base64
}
=
require
(
'
js-base64
'
);
const
{
copyDir
,
removeDir
,
fix2
}
=
require
(
"
./utils
"
);
const
{
spawn
}
=
require
(
"
child_process
"
);
const
fs
=
require
(
"
fs
"
);
const
compressing
=
require
(
'
compressing
'
);
const
{
v4
,
parse
}
=
require
(
'
uuid
'
);
const
{
Base64
}
=
require
(
'
js-base64
'
);
const
{
copyDir
,
removeDir
,
fix2
}
=
require
(
"
./utils
"
);
async
function
buildForm
()
{
const
paths
=
fs
.
readdirSync
(
'
form
'
);
...
...
@@ -52,7 +52,7 @@ function execCmd(cmd, params, path) {
}
let
creatorBasePath
=
'
C:
\\
CocosDashboard_1.0.6
\\
resources
\\
.editors
\\
Creator
\\
2.4.5
\\
CocosCreator.exe
'
;
let
creatorBasePath
=
'
D:
\\
work
\\
CocosDashboard_1.0.9
\\
resources
\\
.editors
\\
Creator
\\
2.4.5
\\
CocosCreator.exe
'
;
if
(
process
.
platform
!==
'
win32
'
)
{
creatorBasePath
=
"
/Applications/CocosCreator/Creator/2.4.5/CocosCreator.app/Contents/MacOS/CocosCreator
"
;
}
...
...
@@ -128,10 +128,10 @@ async function buildWebBundle() {
await
buildCocos
(
args
);
}
function
createConfigFile
(
projectName
,
type
)
{
function
createConfigFile
(
projectName
,
type
)
{
let
iosVersion
=
""
;
let
androidVersion
=
""
;
if
(
!
type
)
{
if
(
!
type
)
{
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidConfigFileName
=
androidPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
...
...
@@ -139,17 +139,17 @@ function createConfigFile (projectName, type) {
const
iosConfigFileName
=
iosPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
}
else
{
if
(
type
==
"
android
"
)
{
if
(
type
==
"
android
"
)
{
const
androidPaths
=
fs
.
readdirSync
(
`dist/android/
${
projectName
}
`
);
const
androidConfigFileName
=
androidPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
androidVersion
=
androidConfigFileName
.
split
(
'
.
'
)[
1
];
}
else
{
}
else
{
const
iosPaths
=
fs
.
readdirSync
(
`dist/ios/
${
projectName
}
`
);
const
iosConfigFileName
=
iosPaths
.
find
(
path
=>
path
.
indexOf
(
'
config
'
)
==
0
);
iosVersion
=
iosConfigFileName
.
split
(
'
.
'
)[
1
];
}
}
const
config
=
{
"
ios
"
:
{
"
sceneName
"
:
projectName
,
...
...
@@ -164,7 +164,7 @@ function createConfigFile (projectName, type) {
fs
.
writeFileSync
(
'
dist/config.json
'
,
JSON
.
stringify
(
config
));
}
function
compressAll
(
projectName
)
{
function
compressAll
(
projectName
)
{
const
tarStream
=
new
compressing
.
zip
.
Stream
();
tarStream
.
addEntry
(
'
dist/play
'
);
tarStream
.
addEntry
(
'
dist/form
'
);
...
...
@@ -176,7 +176,7 @@ function compressAll (projectName) {
tarStream
.
pipe
(
destStream
);
}
function
build_check
()
{
function
build_check
()
{
const
dirNames
=
process
.
cwd
().
split
(
/
\/
|
\\
/
);
const
projectName
=
dirNames
[
dirNames
.
length
-
1
];
const
path
=
'
assets
'
...
...
@@ -211,20 +211,20 @@ function build_check () {
return
projectName
;
}
function
changeSettingToWebDesktop
()
{
function
changeSettingToWebDesktop
()
{
const
path
=
'
assets
'
const
folderName
=
getFolderName
(
path
);
editFolderMeta
(
path
,
folderName
,
false
);
}
function
changeSettingsToBundle
()
{
function
changeSettingsToBundle
()
{
const
path
=
'
assets
'
const
folderName
=
getFolderName
(
path
);
editFolderMeta
(
path
,
folderName
,
true
);
}
function
replaceUuids
()
{
function
replaceUuids
()
{
console
.
log
(
'
build_step_0 开始~!
'
);
const
path
=
'
assets
'
...
...
@@ -303,7 +303,7 @@ function replaceUuids () {
console
.
log
(
'
build_step_0 完成~!
'
);
}
function
replaceIndexHtml
()
{
function
replaceIndexHtml
()
{
const
data
=
fs
.
readFileSync
(
'
index.html
'
);
fs
.
writeFileSync
(
'
dist/play/index.html
'
,
data
);
}
...
...
@@ -313,52 +313,52 @@ module.exports = {
build
:
async
function
()
{
const
startTime
=
new
Date
().
getTime
();
// 构建前检查
const
projectName
=
build_check
();
// 清理旧文件
// 构建form
await
removeDir
(
'
dist/form
'
);
await
buildForm
();
// 替换uuid
replaceUuids
();
// 改设置为非bundle
changeSettingToWebDesktop
();
// 构建play
await
removeDir
(
'
dist/play
'
);
await
buildWebDesktop
();
await
copyDir
(
'
build/web-desktop
'
,
'
dist/play
'
);
replaceIndexHtml
();
console
.
log
(
'
构建 web desktop 成功!
'
);
// 改设置为bundle
changeSettingsToBundle
();
await
removeDir
(
'
dist/android
'
);
await
buildAndroidBundle
();
await
copyDir
(
'
build_android/jsb-link/remote
'
,
'
dist/android
'
);
console
.
log
(
'
构建 android bundle 成功!
'
);
await
removeDir
(
'
dist/ios
'
);
await
buildIosBundle
();
await
copyDir
(
'
build_ios/jsb-link/remote
'
,
'
dist/ios
'
);
console
.
log
(
'
构建 ios bundle 成功!
'
);
await
removeDir
(
'
dist/web_desktop
'
);
await
buildWebBundle
();
await
copyDir
(
`build_web_desktop/web-desktop/assets/
${
projectName
}
`
,
'
dist/web_desktop
'
);
console
.
log
(
'
构建 web bundle 成功!
'
);
// 改设置为非bundle
changeSettingToWebDesktop
();
createConfigFile
(
projectName
);
compressAll
(
projectName
);
await
removeDir
(
'
build
'
);
...
...
@@ -380,11 +380,11 @@ module.exports = {
replaceUuids
();
// 改设置为bundle
changeSettingsToBundle
();
await
removeDir
(
'
dist/android
'
);
await
buildAndroidBundle
();
await
copyDir
(
'
build_android/jsb-link/remote
'
,
'
dist/android
'
);
// 改设置为非bundle
changeSettingToWebDesktop
();
createConfigFile
(
projectName
,
"
android
"
);
...
...
@@ -400,7 +400,7 @@ module.exports = {
replaceUuids
();
// 改设置为bundle
changeSettingsToBundle
();
await
removeDir
(
'
dist/ios
'
);
await
buildIosBundle
();
await
copyDir
(
'
build_ios/jsb-link/remote
'
,
'
dist/ios
'
);
...
...
settings/builder.json
View file @
5cb77a3c
{
"title"
:
"play"
,
"packageName"
:
"org.cocos2d.demo"
,
"startScene"
:
"
0737ce42-24f0-45c6-8e1a-8bdab4f74ba3
"
,
"startScene"
:
"
2d2f792f-a40c-49bb-a189-ed176a246e49
"
,
"excludeScenes"
:
[],
"includeSDKBox"
:
false
,
"orientation"
:
{
...
...
@@ -28,7 +28,8 @@
},
"ios"
:
{
"REMOTE_SERVER_ROOT"
:
""
,
"packageName"
:
"org.cocos2d.demo"
"packageName"
:
"org.cocos2d.demo"
,
"ios_enable_jit"
:
true
},
"mac"
:
{
"REMOTE_SERVER_ROOT"
:
""
,
...
...
@@ -42,7 +43,7 @@
"width"
:
1280
},
"android-instant"
:
{
"REMOTE_SERVER_ROOT"
:
""
,
"REMOTE_SERVER_ROOT"
:
"
http://192.168.43.126:7456/preview-android-instant/
"
,
"host"
:
""
,
"packageName"
:
"org.cocos2d.demo"
,
"pathPattern"
:
""
,
...
...
@@ -50,5 +51,7 @@
"scheme"
:
"https"
,
"skipRecord"
:
false
},
"appBundle"
:
false
"appBundle"
:
false
,
"agreements"
:
{},
"includeAnySDK"
:
false
}
settings/project.json
View file @
5cb77a3c
{
"last-module-event-record-time"
:
16
00677246969
,
"last-module-event-record-time"
:
16
40571810103
,
"migrate-history"
:
[
"cloud-function"
]
...
...
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