Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LWD_2
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
LWD_2
Commits
3599aaa8
Commit
3599aaa8
authored
Jun 17, 2021
by
Lwd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaaa
parent
1b98c460
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
833 additions
and
730 deletions
+833
-730
Course.ts
form/src/app/form/Course.ts
+1
-0
form.component.html
form/src/app/form/form.component.html
+6
-0
GOTHICB_1.TTF
play/assets/tmpGame/fonts/GOTHICB_1.TTF
+0
-0
GOTHICB_1.TTF.meta
play/assets/tmpGame/fonts/GOTHICB_1.TTF.meta
+0
-0
MMTextBook-Bold-1.ttf
play/assets/tmpGame/fonts/MMTextBook-Bold-1.ttf
+0
-0
MMTextBook-Bold-1.ttf.meta
play/assets/tmpGame/fonts/MMTextBook-Bold-1.ttf.meta
+0
-0
ahronbd-1.ttf
play/assets/tmpGame/fonts/ahronbd-1.ttf
+0
-0
ahronbd-1.ttf.meta
play/assets/tmpGame/fonts/ahronbd-1.ttf.meta
+0
-0
华文圆体 REGULAR.TTF
play/assets/tmpGame/fonts/华文圆体 REGULAR.TTF
+0
-0
华文圆体 REGULAR.TTF.meta
play/assets/tmpGame/fonts/华文圆体 REGULAR.TTF.meta
+2
-1
Game.fire
play/assets/tmpGame/scene/Game.fire
+329
-244
game.js
play/assets/tmpGame/script/game/game.js
+269
-260
item.js
play/assets/tmpGame/script/game/item.js
+224
-224
data_mgr.js
play/assets/tmpGame/script/manager/data_mgr.js
+2
-1
No files found.
form/src/app/form/Course.ts
View file @
3599aaa8
...
...
@@ -6,6 +6,7 @@ export class Course {
title
:
string
;
audio_url
:
string
;
}
export
class
Sheepfold
{
...
...
form/src/app/form/form.component.html
View file @
3599aaa8
...
...
@@ -8,6 +8,12 @@
</div>
</div>
<nz-form-control
[
nzSpan
]="
18
"
>
<span>
标题声音:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
audio_url
')"
>
</app-audio-recorder>
</nz-form-control>
<nz-divider
nzText=
"类别"
nzOrientation=
"left"
></nz-divider>
<!-- <div nz-row>
<nz-form-item>
...
...
play/assets/
resources/font
/GOTHICB_1.TTF
→
play/assets/
tmpGame/fonts
/GOTHICB_1.TTF
View file @
3599aaa8
File moved
play/assets/
resources/font
/GOTHICB_1.TTF.meta
→
play/assets/
tmpGame/fonts
/GOTHICB_1.TTF.meta
View file @
3599aaa8
File moved
play/assets/
resources/font
/MMTextBook-Bold-1.ttf
→
play/assets/
tmpGame/fonts
/MMTextBook-Bold-1.ttf
View file @
3599aaa8
File moved
play/assets/
resources/font
/MMTextBook-Bold-1.ttf.meta
→
play/assets/
tmpGame/fonts
/MMTextBook-Bold-1.ttf.meta
View file @
3599aaa8
File moved
play/assets/
resources/font
/ahronbd-1.ttf
→
play/assets/
tmpGame/fonts
/ahronbd-1.ttf
View file @
3599aaa8
File moved
play/assets/
resources/font
/ahronbd-1.ttf.meta
→
play/assets/
tmpGame/fonts
/ahronbd-1.ttf.meta
View file @
3599aaa8
File moved
play/assets/
resources/font
/华文圆体 REGULAR.TTF
→
play/assets/
tmpGame/fonts
/华文圆体 REGULAR.TTF
View file @
3599aaa8
File moved
play/assets/
resources/font
/华文圆体 REGULAR.TTF.meta
→
play/assets/
tmpGame/fonts
/华文圆体 REGULAR.TTF.meta
View file @
3599aaa8
{
"ver": "1.1.0",
"uuid": "
41ef287f-ba46-4313-a114-676b6eae4bca
",
"uuid": "
5c0041d0-ccbd-4069-bc12-73a47695ed52
",
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/scene/Game.fire
View file @
3599aaa8
...
...
@@ -17,10 +17,10 @@
"__id__": 2
},
{
"__id__": 10
1
"__id__": 10
3
},
{
"__id__": 12
7
"__id__": 12
9
}
],
"_active": false,
...
...
@@ -81,25 +81,25 @@
"__id__": 5
},
{
"__id__": 9
4
"__id__": 9
6
}
],
"_active": true,
"_components": [
{
"__id__": 9
6
"__id__": 9
8
},
{
"__id__": 9
7
"__id__": 9
9
},
{
"__id__":
98
"__id__":
100
},
{
"__id__":
99
"__id__":
101
},
{
"__id__": 10
0
"__id__": 10
2
}
],
"_prefab": null,
...
...
@@ -189,7 +189,7 @@
"array": [
0,
0,
234.692884425582
9,
355.070415551619
9,
0,
0,
0,
...
...
@@ -263,7 +263,7 @@
"__id__": 8
},
{
"__id__": 9
0
"__id__": 9
2
}
],
"_active": true,
...
...
@@ -425,25 +425,25 @@
"__id__": 12
},
{
"__id__":
18
"__id__":
20
},
{
"__id__": 5
0
"__id__": 5
2
},
{
"__id__": 5
3
"__id__": 5
5
},
{
"__id__": 5
6
"__id__": 5
8
},
{
"__id__": 7
0
"__id__": 7
2
},
{
"__id__": 8
4
"__id__": 8
6
},
{
"__id__":
89
"__id__":
91
}
],
"_active": true,
...
...
@@ -639,6 +639,9 @@
},
{
"__id__": 17
},
{
"__id__": 18
}
],
"_prefab": null,
...
...
@@ -866,6 +869,88 @@
"_originalHeight": 0,
"_id": "30udG3x11IJILlcDYWntvI"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 19
}
],
"_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": "abUKtv5QRNCLyNL/iuR+Cu"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "8b0b7lMf15OlIK40chbxp64",
"handler": "playAudioTitle",
"customEventData": ""
},
{
"__type__": "cc.Node",
"_name": "Layout",
...
...
@@ -875,16 +960,16 @@
},
"_children": [
{
"__id__":
19
"__id__":
21
},
{
"__id__": 3
4
"__id__": 3
6
}
],
"_active": true,
"_components": [
{
"__id__":
49
"__id__":
51
}
],
"_prefab": null,
...
...
@@ -940,12 +1025,9 @@
"_name": "connent_1",
"_objFlags": 0,
"_parent": {
"__id__":
18
"__id__":
20
},
"_children": [
{
"__id__": 20
},
{
"__id__": 22
},
...
...
@@ -953,16 +1035,19 @@
"__id__": 24
},
{
"__id__": 2
8
"__id__": 2
6
},
{
"__id__": 30
},
{
"__id__": 32
}
],
"_active": true,
"_components": [
{
"__id__": 3
3
"__id__": 3
5
}
],
"_prefab": null,
...
...
@@ -1018,13 +1103,13 @@
"_name": "connent_2",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
1
"__id__": 2
3
}
],
"_prefab": null,
...
...
@@ -1080,7 +1165,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
0
"__id__": 2
2
},
"_enabled": true,
"_materials": [
...
...
@@ -1112,13 +1197,13 @@
"_name": "connent_4",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
3
"__id__": 2
5
}
],
"_prefab": null,
...
...
@@ -1174,7 +1259,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
2
"__id__": 2
4
},
"_enabled": true,
"_materials": [
...
...
@@ -1206,17 +1291,17 @@
"_name": "connent_3",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
21
},
"_children": [
{
"__id__": 2
5
"__id__": 2
7
}
],
"_active": true,
"_components": [
{
"__id__": 2
7
"__id__": 2
9
}
],
"_prefab": null,
...
...
@@ -1272,13 +1357,13 @@
"_name": "Layout",
"_objFlags": 0,
"_parent": {
"__id__": 2
4
"__id__": 2
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
6
"__id__": 2
8
}
],
"_prefab": null,
...
...
@@ -1334,7 +1419,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
5
"__id__": 2
7
},
"_enabled": true,
"_layoutSize": {
...
...
@@ -1366,7 +1451,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
4
"__id__": 2
6
},
"_enabled": true,
"_materials": [
...
...
@@ -1398,13 +1483,13 @@
"_name": "db",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
21
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
29
"__id__":
31
}
],
"_prefab": null,
...
...
@@ -1460,7 +1545,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
28
"__id__":
30
},
"_enabled": true,
"_materials": [
...
...
@@ -1500,16 +1585,16 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
1
"__id__": 3
3
},
{
"__id__": 3
2
"__id__": 3
4
}
],
"_prefab": null,
...
...
@@ -1565,7 +1650,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
0
"__id__": 3
2
},
"_enabled": true,
"_materials": [
...
...
@@ -1600,7 +1685,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
0
"__id__": 3
2
},
"_enabled": true,
"_color": {
...
...
@@ -1618,7 +1703,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
19
"__id__":
21
},
"_enabled": true,
"_materials": [
...
...
@@ -1650,12 +1735,9 @@
"_name": "connent_1",
"_objFlags": 0,
"_parent": {
"__id__":
18
"__id__":
20
},
"_children": [
{
"__id__": 35
},
{
"__id__": 37
},
...
...
@@ -1663,16 +1745,19 @@
"__id__": 39
},
{
"__id__": 4
3
"__id__": 4
1
},
{
"__id__": 45
},
{
"__id__": 47
}
],
"_active": true,
"_components": [
{
"__id__":
48
"__id__":
50
}
],
"_prefab": null,
...
...
@@ -1728,13 +1813,13 @@
"_name": "connent_2",
"_objFlags": 0,
"_parent": {
"__id__": 3
4
"__id__": 3
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
6
"__id__": 3
8
}
],
"_prefab": null,
...
...
@@ -1790,7 +1875,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
5
"__id__": 3
7
},
"_enabled": true,
"_materials": [
...
...
@@ -1822,13 +1907,13 @@
"_name": "connent_4",
"_objFlags": 0,
"_parent": {
"__id__": 3
4
"__id__": 3
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
38
"__id__":
40
}
],
"_prefab": null,
...
...
@@ -1884,7 +1969,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
7
"__id__": 3
9
},
"_enabled": true,
"_materials": [
...
...
@@ -1916,17 +2001,17 @@
"_name": "connent_3",
"_objFlags": 0,
"_parent": {
"__id__": 3
4
"__id__": 3
6
},
"_children": [
{
"__id__": 4
0
"__id__": 4
2
}
],
"_active": true,
"_components": [
{
"__id__": 4
2
"__id__": 4
4
}
],
"_prefab": null,
...
...
@@ -1982,13 +2067,13 @@
"_name": "Layout",
"_objFlags": 0,
"_parent": {
"__id__":
39
"__id__":
41
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
1
"__id__": 4
3
}
],
"_prefab": null,
...
...
@@ -2044,7 +2129,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
0
"__id__": 4
2
},
"_enabled": true,
"_layoutSize": {
...
...
@@ -2076,7 +2161,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
39
"__id__":
41
},
"_enabled": true,
"_materials": [
...
...
@@ -2108,13 +2193,13 @@
"_name": "db",
"_objFlags": 0,
"_parent": {
"__id__": 3
4
"__id__": 3
6
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 4
4
"__id__": 4
6
}
],
"_prefab": null,
...
...
@@ -2170,7 +2255,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
3
"__id__": 4
5
},
"_enabled": true,
"_materials": [
...
...
@@ -2210,16 +2295,16 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 3
4
"__id__": 3
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
6
"__id__": 4
8
},
{
"__id__": 4
7
"__id__": 4
9
}
],
"_prefab": null,
...
...
@@ -2275,7 +2360,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
5
"__id__": 4
7
},
"_enabled": true,
"_materials": [
...
...
@@ -2310,7 +2395,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
5
"__id__": 4
7
},
"_enabled": true,
"_color": {
...
...
@@ -2328,7 +2413,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
4
"__id__": 3
6
},
"_enabled": true,
"_materials": [
...
...
@@ -2360,7 +2445,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
18
"__id__":
20
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2393,10 +2478,10 @@
"_active": true,
"_components": [
{
"__id__": 5
1
"__id__": 5
3
},
{
"__id__": 5
2
"__id__": 5
4
}
],
"_prefab": null,
...
...
@@ -2452,7 +2537,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
0
"__id__": 5
2
},
"_enabled": true,
"_layoutSize": {
...
...
@@ -2484,7 +2569,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
0
"__id__": 5
2
},
"_enabled": true,
"alignMode": 2,
...
...
@@ -2517,10 +2602,10 @@
"_active": true,
"_components": [
{
"__id__": 5
4
"__id__": 5
6
},
{
"__id__": 5
5
"__id__": 5
7
}
],
"_prefab": null,
...
...
@@ -2576,7 +2661,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
3
"__id__": 5
5
},
"_enabled": true,
"_layoutSize": {
...
...
@@ -2608,7 +2693,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
3
"__id__": 5
5
},
"_enabled": true,
"alignMode": 2,
...
...
@@ -2639,7 +2724,7 @@
},
"_children": [
{
"__id__": 5
7
"__id__": 5
9
}
],
"_active": false,
...
...
@@ -2697,12 +2782,9 @@
"_name": "item",
"_objFlags": 0,
"_parent": {
"__id__": 5
6
"__id__": 5
8
},
"_children": [
{
"__id__": 58
},
{
"__id__": 60
},
...
...
@@ -2710,16 +2792,19 @@
"__id__": 62
},
{
"__id__": 66
"__id__": 64
},
{
"__id__": 68
}
],
"_active": true,
"_components": [
{
"__id__":
68
"__id__":
70
},
{
"__id__":
69
"__id__":
71
}
],
"_prefab": null,
...
...
@@ -2775,13 +2860,13 @@
"_name": "item_bg3",
"_objFlags": 0,
"_parent": {
"__id__": 5
7
"__id__": 5
9
},
"_children": [],
"_active": false,
"_components": [
{
"__id__":
59
"__id__":
61
}
],
"_prefab": null,
...
...
@@ -2837,7 +2922,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
58
"__id__":
60
},
"_enabled": true,
"_materials": [
...
...
@@ -2869,13 +2954,13 @@
"_name": "name",
"_objFlags": 0,
"_parent": {
"__id__": 5
7
"__id__": 5
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
1
"__id__": 6
3
}
],
"_prefab": null,
...
...
@@ -2931,7 +3016,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
0
"__id__": 6
2
},
"_enabled": true,
"_materials": [
...
...
@@ -2947,7 +3032,7 @@
"_lineHeight": 32,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "
41ef287f-ba46-4313-a114-676b6eae4bca
"
"__uuid__": "
5c0041d0-ccbd-4069-bc12-73a47695ed52
"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
...
...
@@ -2966,17 +3051,17 @@
"_name": "red",
"_objFlags": 0,
"_parent": {
"__id__": 5
7
"__id__": 5
9
},
"_children": [
{
"__id__": 6
3
"__id__": 6
5
}
],
"_active": false,
"_components": [
{
"__id__": 6
5
"__id__": 6
7
}
],
"_prefab": null,
...
...
@@ -3032,13 +3117,13 @@
"_name": "name",
"_objFlags": 0,
"_parent": {
"__id__": 6
2
"__id__": 6
4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
4
"__id__": 6
6
}
],
"_prefab": null,
...
...
@@ -3094,7 +3179,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
3
"__id__": 6
5
},
"_enabled": true,
"_materials": [
...
...
@@ -3110,7 +3195,7 @@
"_lineHeight": 32,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "
41ef287f-ba46-4313-a114-676b6eae4bca
"
"__uuid__": "
5c0041d0-ccbd-4069-bc12-73a47695ed52
"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
...
...
@@ -3129,7 +3214,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
2
"__id__": 6
4
},
"_enabled": true,
"_materials": [
...
...
@@ -3161,13 +3246,13 @@
"_name": "photo",
"_objFlags": 0,
"_parent": {
"__id__": 5
7
"__id__": 5
9
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 6
7
"__id__": 6
9
}
],
"_prefab": null,
...
...
@@ -3223,7 +3308,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
6
"__id__": 6
8
},
"_enabled": true,
"_materials": [
...
...
@@ -3255,7 +3340,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
7
"__id__": 5
9
},
"_enabled": true,
"_materials": [
...
...
@@ -3287,20 +3372,20 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
7
"__id__": 5
9
},
"_enabled": true,
"Item_name": {
"__id__": 6
1
"__id__": 6
3
},
"Item_redName": {
"__id__": 6
4
"__id__": 6
6
},
"Item_photo": {
"__id__": 6
6
"__id__": 6
8
},
"Item_complete": {
"__id__":
58
"__id__":
60
},
"_id": "c6/2WIOWRJ1bavF5ytftPN"
},
...
...
@@ -3313,7 +3398,7 @@
},
"_children": [
{
"__id__": 7
1
"__id__": 7
3
}
],
"_active": false,
...
...
@@ -3371,12 +3456,9 @@
"_name": "item",
"_objFlags": 0,
"_parent": {
"__id__": 7
0
"__id__": 7
2
},
"_children": [
{
"__id__": 72
},
{
"__id__": 74
},
...
...
@@ -3384,16 +3466,19 @@
"__id__": 76
},
{
"__id__": 80
"__id__": 78
},
{
"__id__": 82
}
],
"_active": true,
"_components": [
{
"__id__": 8
2
"__id__": 8
4
},
{
"__id__": 8
3
"__id__": 8
5
}
],
"_prefab": null,
...
...
@@ -3449,13 +3534,13 @@
"_name": "item_bg3",
"_objFlags": 0,
"_parent": {
"__id__": 7
1
"__id__": 7
3
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 7
3
"__id__": 7
5
}
],
"_prefab": null,
...
...
@@ -3511,7 +3596,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
2
"__id__": 7
4
},
"_enabled": true,
"_materials": [
...
...
@@ -3543,13 +3628,13 @@
"_name": "name",
"_objFlags": 0,
"_parent": {
"__id__": 7
1
"__id__": 7
3
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
5
"__id__": 7
7
}
],
"_prefab": null,
...
...
@@ -3605,7 +3690,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
4
"__id__": 7
6
},
"_enabled": true,
"_materials": [
...
...
@@ -3621,7 +3706,7 @@
"_lineHeight": 44,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "
41ef287f-ba46-4313-a114-676b6eae4bca
"
"__uuid__": "
5c0041d0-ccbd-4069-bc12-73a47695ed52
"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
...
...
@@ -3640,17 +3725,17 @@
"_name": "red",
"_objFlags": 0,
"_parent": {
"__id__": 7
1
"__id__": 7
3
},
"_children": [
{
"__id__": 7
7
"__id__": 7
9
}
],
"_active": false,
"_components": [
{
"__id__":
79
"__id__":
81
}
],
"_prefab": null,
...
...
@@ -3706,13 +3791,13 @@
"_name": "name",
"_objFlags": 0,
"_parent": {
"__id__": 7
6
"__id__": 7
8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
78
"__id__":
80
}
],
"_prefab": null,
...
...
@@ -3768,7 +3853,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
7
"__id__": 7
9
},
"_enabled": true,
"_materials": [
...
...
@@ -3784,7 +3869,7 @@
"_lineHeight": 44,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "
41ef287f-ba46-4313-a114-676b6eae4bca
"
"__uuid__": "
5c0041d0-ccbd-4069-bc12-73a47695ed52
"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
...
...
@@ -3803,7 +3888,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
6
"__id__": 7
8
},
"_enabled": true,
"_materials": [
...
...
@@ -3835,13 +3920,13 @@
"_name": "photo",
"_objFlags": 0,
"_parent": {
"__id__": 7
1
"__id__": 7
3
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 8
1
"__id__": 8
3
}
],
"_prefab": null,
...
...
@@ -3897,7 +3982,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
0
"__id__": 8
2
},
"_enabled": true,
"_materials": [
...
...
@@ -3929,7 +4014,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
1
"__id__": 7
3
},
"_enabled": true,
"_materials": [
...
...
@@ -3961,20 +4046,20 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
1
"__id__": 7
3
},
"_enabled": true,
"Item_name": {
"__id__": 7
5
"__id__": 7
7
},
"Item_redName": {
"__id__":
78
"__id__":
80
},
"Item_photo": {
"__id__": 8
0
"__id__": 8
2
},
"Item_complete": {
"__id__": 7
2
"__id__": 7
4
},
"_id": "d3S/vW/XNO7Z5Jrqs6S78C"
},
...
...
@@ -3989,13 +4074,13 @@
"_active": true,
"_components": [
{
"__id__": 8
5
"__id__": 8
7
},
{
"__id__": 8
6
"__id__": 8
8
},
{
"__id__": 8
7
"__id__": 8
9
}
],
"_prefab": null,
...
...
@@ -4051,7 +4136,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
4
"__id__": 8
6
},
"_enabled": true,
"_materials": [
...
...
@@ -4083,7 +4168,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
4
"__id__": 8
6
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -4110,7 +4195,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
4
"__id__": 8
6
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -4119,7 +4204,7 @@
"zoomScale": 0.95,
"clickEvents": [
{
"__id__":
88
"__id__":
90
}
],
"_N$interactable": true,
...
...
@@ -4256,10 +4341,10 @@
"_active": false,
"_components": [
{
"__id__": 9
1
"__id__": 9
3
},
{
"__id__": 9
2
"__id__": 9
4
}
],
"_prefab": null,
...
...
@@ -4315,7 +4400,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
0
"__id__": 9
2
},
"_enabled": true,
"_id": "80PylZIy9EbJR4/AZl0xgK"
...
...
@@ -4325,7 +4410,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
0
"__id__": 9
2
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -4334,7 +4419,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 9
3
"__id__": 9
5
}
],
"_N$interactable": true,
...
...
@@ -4413,7 +4498,7 @@
"_active": true,
"_components": [
{
"__id__": 9
5
"__id__": 9
7
}
],
"_prefab": null,
...
...
@@ -4469,7 +4554,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
4
"__id__": 9
6
},
"_enabled": true,
"eff_btn": {
...
...
@@ -4552,29 +4637,29 @@
"_enabled": true,
"Item_0": [
{
"__id__": 5
6
"__id__": 5
8
},
{
"__id__": 7
0
"__id__": 7
2
},
{
"__id__":
89
"__id__":
91
}
],
"contentArr_2": [
{
"__id__": 5
0
"__id__": 5
2
},
{
"__id__": 5
3
"__id__": 5
5
}
],
"contentArr_1": [
{
"__id__":
19
"__id__":
21
},
{
"__id__": 3
4
"__id__": 3
6
}
],
"lb_title": {
...
...
@@ -4604,7 +4689,7 @@
}
],
"canvasView": {
"__id__": 9
6
"__id__": 9
8
},
"isCanvas": true,
"_id": "5eOVDDzARGnoMLcNXyk5ml"
...
...
@@ -4628,19 +4713,19 @@
},
"_children": [
{
"__id__": 10
2
"__id__": 10
4
},
{
"__id__": 10
7
"__id__": 10
9
},
{
"__id__": 11
2
"__id__": 11
4
},
{
"__id__": 11
7
"__id__": 11
9
},
{
"__id__": 12
2
"__id__": 12
4
}
],
"_active": true,
...
...
@@ -4698,11 +4783,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 10
1
"__id__": 10
3
},
"_children": [
{
"__id__": 10
3
"__id__": 10
5
}
],
"_active": true,
...
...
@@ -4760,17 +4845,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 10
2
"__id__": 10
4
},
"_children": [
{
"__id__": 10
4
"__id__": 10
6
}
],
"_active": true,
"_components": [
{
"__id__": 10
6
"__id__": 10
8
}
],
"_prefab": null,
...
...
@@ -4826,13 +4911,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 10
3
"__id__": 10
5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
5
"__id__": 10
7
}
],
"_prefab": null,
...
...
@@ -4888,7 +4973,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
4
"__id__": 10
6
},
"_enabled": true,
"_materials": [
...
...
@@ -4920,7 +5005,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
3
"__id__": 10
5
},
"_enabled": true,
"_materials": [
...
...
@@ -4942,11 +5027,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 10
1
"__id__": 10
3
},
"_children": [
{
"__id__": 1
08
"__id__": 1
10
}
],
"_active": true,
...
...
@@ -5004,17 +5089,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 10
7
"__id__": 10
9
},
"_children": [
{
"__id__": 1
09
"__id__": 1
11
}
],
"_active": true,
"_components": [
{
"__id__": 11
1
"__id__": 11
3
}
],
"_prefab": null,
...
...
@@ -5070,13 +5155,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 1
08
"__id__": 1
10
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
0
"__id__": 11
2
}
],
"_prefab": null,
...
...
@@ -5132,7 +5217,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
09
"__id__": 1
11
},
"_enabled": true,
"_materials": [
...
...
@@ -5164,7 +5249,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
08
"__id__": 1
10
},
"_enabled": true,
"_materials": [
...
...
@@ -5186,11 +5271,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 10
1
"__id__": 10
3
},
"_children": [
{
"__id__": 11
3
"__id__": 11
5
}
],
"_active": true,
...
...
@@ -5248,17 +5333,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 11
2
"__id__": 11
4
},
"_children": [
{
"__id__": 11
4
"__id__": 11
6
}
],
"_active": true,
"_components": [
{
"__id__": 11
6
"__id__": 11
8
}
],
"_prefab": null,
...
...
@@ -5314,13 +5399,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 11
3
"__id__": 11
5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
5
"__id__": 11
7
}
],
"_prefab": null,
...
...
@@ -5376,7 +5461,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
4
"__id__": 11
6
},
"_enabled": true,
"_materials": [
...
...
@@ -5408,7 +5493,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
3
"__id__": 11
5
},
"_enabled": true,
"_materials": [
...
...
@@ -5430,11 +5515,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 10
1
"__id__": 10
3
},
"_children": [
{
"__id__": 1
18
"__id__": 1
20
}
],
"_active": true,
...
...
@@ -5492,17 +5577,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 11
7
"__id__": 11
9
},
"_children": [
{
"__id__": 1
19
"__id__": 1
21
}
],
"_active": true,
"_components": [
{
"__id__": 12
1
"__id__": 12
3
}
],
"_prefab": null,
...
...
@@ -5558,13 +5643,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 1
18
"__id__": 1
20
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
0
"__id__": 12
2
}
],
"_prefab": null,
...
...
@@ -5620,7 +5705,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
19
"__id__": 1
21
},
"_enabled": true,
"_materials": [
...
...
@@ -5652,7 +5737,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
18
"__id__": 1
20
},
"_enabled": true,
"_materials": [
...
...
@@ -5674,11 +5759,11 @@
"_name": "quadBase",
"_objFlags": 0,
"_parent": {
"__id__": 10
1
"__id__": 10
3
},
"_children": [
{
"__id__": 12
3
"__id__": 12
5
}
],
"_active": true,
...
...
@@ -5736,17 +5821,17 @@
"_name": "quad",
"_objFlags": 0,
"_parent": {
"__id__": 12
2
"__id__": 12
4
},
"_children": [
{
"__id__": 12
4
"__id__": 12
6
}
],
"_active": true,
"_components": [
{
"__id__": 12
6
"__id__": 12
8
}
],
"_prefab": null,
...
...
@@ -5802,13 +5887,13 @@
"_name": "paper",
"_objFlags": 0,
"_parent": {
"__id__": 12
3
"__id__": 12
5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
5
"__id__": 12
7
}
],
"_prefab": null,
...
...
@@ -5864,7 +5949,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
4
"__id__": 12
6
},
"_enabled": true,
"_materials": [
...
...
@@ -5896,7 +5981,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
3
"__id__": 12
5
},
"_enabled": true,
"_materials": [
...
...
@@ -5921,9 +6006,6 @@
"__id__": 1
},
"_children": [
{
"__id__": 128
},
{
"__id__": 130
},
...
...
@@ -5935,6 +6017,9 @@
},
{
"__id__": 136
},
{
"__id__": 138
}
],
"_active": true,
...
...
@@ -5992,13 +6077,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 12
7
"__id__": 12
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
29
"__id__": 1
31
}
],
"_prefab": null,
...
...
@@ -6054,7 +6139,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
28
"__id__": 1
30
},
"_enabled": true,
"_materials": [
...
...
@@ -6062,7 +6147,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor":
770
,
"_srcBlendFactor":
1
,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "130348e9-f1a0-4858-8d2a-dfd298bc57f1"
...
...
@@ -6086,13 +6171,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 12
7
"__id__": 12
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
1
"__id__": 13
3
}
],
"_prefab": null,
...
...
@@ -6148,7 +6233,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
0
"__id__": 13
2
},
"_enabled": true,
"_materials": [
...
...
@@ -6156,7 +6241,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor":
770
,
"_srcBlendFactor":
1
,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "130348e9-f1a0-4858-8d2a-dfd298bc57f1"
...
...
@@ -6180,13 +6265,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 12
7
"__id__": 12
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
3
"__id__": 13
5
}
],
"_prefab": null,
...
...
@@ -6242,7 +6327,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
2
"__id__": 13
4
},
"_enabled": true,
"_materials": [
...
...
@@ -6250,7 +6335,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor":
770
,
"_srcBlendFactor":
1
,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "130348e9-f1a0-4858-8d2a-dfd298bc57f1"
...
...
@@ -6274,13 +6359,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 12
7
"__id__": 12
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
5
"__id__": 13
7
}
],
"_prefab": null,
...
...
@@ -6336,7 +6421,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
4
"__id__": 13
6
},
"_enabled": true,
"_materials": [
...
...
@@ -6344,7 +6429,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor":
770
,
"_srcBlendFactor":
1
,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "130348e9-f1a0-4858-8d2a-dfd298bc57f1"
...
...
@@ -6368,13 +6453,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 12
7
"__id__": 12
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 13
7
"__id__": 13
9
}
],
"_prefab": null,
...
...
@@ -6430,7 +6515,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
6
"__id__": 13
8
},
"_enabled": true,
"_materials": [
...
...
@@ -6438,7 +6523,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor":
770
,
"_srcBlendFactor":
1
,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "130348e9-f1a0-4858-8d2a-dfd298bc57f1"
...
...
play/assets/tmpGame/script/game/game.js
View file @
3599aaa8
...
...
@@ -2,264 +2,273 @@
* 游戏主逻辑
*/
var
game
=
cc
.
Class
({
extends
:
cc
.
Component
,
properties
:
{
Item_0
:
{
default
:
[],
type
:
cc
.
Node
,
displayName
:
"
预制体
"
},
contentArr_2
:
{
default
:
[],
type
:
cc
.
Node
,
displayName
:
"
底下内容2
"
},
contentArr_1
:
{
default
:
[],
type
:
cc
.
Node
,
displayName
:
"
目标位置
"
},
lb_title
:
{
default
:
null
,
type
:
cc
.
Label
,
displayName
:
"
大标题
"
},
// btnList: {
// default: [],
// type: cc.Button,
// displayName: "上下页"
// },
mask_node
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
遮罩
"
}
},
ctor
:
function
()
{
game
.
inst
=
this
;
g
.
game
=
game
;
},
// 生命周期 onLoad
onLoad
()
{
//初始化游戏
this
.
initGame
();
if
(
window
.
addEventListener
)
{
window
.
addEventListener
(
'
resize
'
,
this
.
scaleEventCallBack
,
false
)
}
else
if
(
window
.
attachEvent
)
{
window
.
attachEvent
(
'
resize
'
,
this
.
scaleEventCallBack
,
false
)
}
},
//屏幕缩放
scaleEventCallBack
:
function
()
{
g
.
event_mgr
.
send
(
"
adjustUI
"
);
},
//初始化游戏
initGame
:
function
()
{
//获得数据
g
.
res_mgr
.
getFormData
();
},
setAABB
(
Id
)
{
var
node
=
this
.
contentArr_1
[
Id
]
let
svLeftBottomPoint
=
node
.
parent
.
convertToWorldSpaceAR
(
cc
.
v2
(
node
.
x
-
node
.
anchorX
*
node
.
width
/
2
,
node
.
y
-
node
.
anchorY
*
node
.
height
/
2
)
);
// 求出 ScrollView 可视区域在世界坐标系中的矩形(碰撞盒)
let
svBBoxRect
=
cc
.
rect
(
svLeftBottomPoint
.
x
-
120
,
svLeftBottomPoint
.
y
-
100
,
node
.
width
,
node
.
height
);
// console.log(Id + ":" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y);
return
svBBoxRect
},
//检查当前缩放倍数
checkScale
:
function
(
num
)
{
var
scale
=
1
;
if
(
num
>
2
&&
num
<=
4
)
{
scale
=
0.74
}
if
(
num
>
4
)
{
scale
=
0.65
}
return
scale
;
},
//添加节点
addItem
:
function
()
{
let
itemArr
=
g
.
data_mgr
.
getSheepArr
();
this
.
idx
=
this
.
checkNodeParent
();
g
.
data_mgr
.
nowNum
=
itemArr
.
length
;
itemArr
.
sort
(
function
()
{
return
Math
.
random
()
>
0.5
?
-
1
:
1
;
})
for
(
var
i
=
0
;
i
<
itemArr
.
length
;
i
++
)
{
let
newItem_0
=
cc
.
instantiate
(
this
.
Item_0
[
itemArr
.
length
>
14
?
0
:
1
]);
//let newItem_1 = cc.instantiate(this.Item_1);
//更新子项
var
com
=
newItem_0
.
getChildByName
(
"
item
"
).
getComponent
(
"
item
"
);
let
itemInfo
=
itemArr
[
i
];
com
.
updateUI
(
itemInfo
);
newItem_0
.
active
=
true
;
// newItem_1.active = true;
//设置类别
let
sheepInfo
=
g
.
data_mgr
.
getSheep
(
i
);
newItem_0
.
getChildByName
(
"
item
"
).
type
=
this
.
checkType
(
sheepInfo
.
sheepfoldId
);
// newItem_1.parent = newItem_0;
// newItem_0.parent = this.contentArr;
// var idx = this.checkNodeParent(i);
newItem_0
.
parent
=
this
.
contentArr_2
[
this
.
idx
];
};
},
//检测放到哪个节点底下
checkNodeParent
:
function
()
{
//获取到总列表
var
itemArr
=
g
.
data_mgr
.
getSheepArr
();
//
if
(
itemArr
.
length
<=
7
)
{
this
.
contentArr_2
[
1
].
active
=
true
;
var
idx
=
1
;
}
else
{
this
.
contentArr_2
[
0
].
active
=
true
;
var
idx
=
0
;
}
return
idx
;
},
//检查类别
checkType
:
function
(
Id
)
{
for
(
var
i
in
g
.
data_mgr
.
getSheepfoldArr
())
{
var
sheepfoldInfo
=
g
.
data_mgr
.
getSheepfoldArr
()[
i
];
if
(
Id
==
sheepfoldInfo
.
id
)
{
return
~~
i
+
1
;
}
}
return
-
1
;
},
//更新界面信息
UpdataUi
:
function
()
{
//设置大标题
this
.
lb_title
.
string
=
g
.
data_mgr
.
getTitle
();
//设置俩个标题
this
.
contentArr_1
[
0
].
getChildByName
(
"
title
"
).
getComponent
(
cc
.
Label
).
string
=
g
.
data_mgr
.
getSheepfold
(
0
).
word
;
//设置俩个标题
this
.
contentArr_1
[
1
].
getChildByName
(
"
title
"
).
getComponent
(
cc
.
Label
).
string
=
g
.
data_mgr
.
getSheepfold
(
1
).
word
;
//重置UI界面
this
.
resetUI
();
//添加项
this
.
addItem
();
// //设置上下页按钮状态
// this.setButtonState();
},
//重置UI界面
resetUI
:
function
()
{
//移除所有子节点
this
.
contentArr_2
[
0
].
removeAllChildren
();
this
.
contentArr_2
[
1
].
removeAllChildren
();
this
.
contentArr_1
[
0
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
).
removeAllChildren
();
this
.
contentArr_1
[
1
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
).
removeAllChildren
();
},
//重新开始
onBtnReStart
:
function
()
{
g
.
speaker
.
inst
.
play_btn
();
//移除所有计时器
this
.
unscheduleAllCallbacks
();
//初始化界面
this
.
UpdataUi
();
g
.
speaker
.
inst
.
play_restart
();
},
//游戏开始
gameStart
:
function
()
{
console
.
log
(
"
游戏开始:
"
+
g
.
data_mgr
);
//播放一个上面的音乐
this
.
setAudioInfo
(
1
);
},
//设置上下页按钮状态
setButtonState
:
function
()
{
//先判断题目长度
if
(
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
<
2
)
{
this
.
btnList
[
0
].
node
.
active
=
false
;
this
.
btnList
[
1
].
node
.
active
=
false
;
}
else
{
//如果第一页
if
(
g
.
data_mgr
.
pageId
==
0
)
{
this
.
btnList
[
1
].
node
.
active
=
true
;
this
.
btnList
[
0
].
node
.
active
=
false
;
}
if
(
g
.
data_mgr
.
pageId
==
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
this
.
btnList
[
0
].
node
.
active
=
true
;
this
.
btnList
[
1
].
node
.
active
=
false
;
}
if
(
g
.
data_mgr
.
pageId
>
0
&&
g
.
data_mgr
.
pageId
<
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
this
.
btnList
[
0
].
node
.
active
=
true
;
this
.
btnList
[
1
].
node
.
active
=
true
;
}
}
},
//上一关
onBtnLastPage
:
function
()
{
g
.
speaker
.
inst
.
play_btn
();
if
(
g
.
data_mgr
.
pageId
-
1
>=
0
)
{
g
.
data_mgr
.
pageId
-=
1
;
this
.
setButtonState
();
this
.
onBtnReStart
();
}
},
//下一关
onBtnNextPage
:
function
()
{
g
.
speaker
.
inst
.
play_btn
();
if
(
g
.
data_mgr
.
pageId
+
1
<
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
)
{
g
.
data_mgr
.
pageId
+=
1
;
this
.
setButtonState
();
this
.
onBtnReStart
();
}
},
onBtnMask
:
function
()
{
if
(
this
.
isLoadEnd
)
{
this
.
isLoadEnd
=
false
;
g
.
speaker
.
inst
.
play_start
(()
=>
{
setTimeout
(()
=>
{
g
.
game
.
inst
.
playAudioTitle
(()
=>
{
g
.
game
.
inst
.
mask_node
.
active
=
false
;
//游戏开始
g
.
game
.
inst
.
gameStart
();
});
},
500
)
});
}
},
extends
:
cc
.
Component
,
properties
:
{
Item_0
:
{
default
:
[],
type
:
cc
.
Node
,
displayName
:
"
预制体
"
},
contentArr_2
:
{
default
:
[],
type
:
cc
.
Node
,
displayName
:
"
底下内容2
"
},
contentArr_1
:
{
default
:
[],
type
:
cc
.
Node
,
displayName
:
"
目标位置
"
},
lb_title
:
{
default
:
null
,
type
:
cc
.
Label
,
displayName
:
"
大标题
"
},
// btnList: {
// default: [],
// type: cc.Button,
// displayName: "上下页"
// },
mask_node
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
遮罩
"
}
},
ctor
:
function
()
{
game
.
inst
=
this
;
g
.
game
=
game
;
},
// 生命周期 onLoad
onLoad
()
{
//初始化游戏
this
.
initGame
();
if
(
window
.
addEventListener
)
{
window
.
addEventListener
(
'
resize
'
,
this
.
scaleEventCallBack
,
false
)
}
else
if
(
window
.
attachEvent
)
{
window
.
attachEvent
(
'
resize
'
,
this
.
scaleEventCallBack
,
false
)
}
},
//屏幕缩放
scaleEventCallBack
:
function
()
{
g
.
event_mgr
.
send
(
"
adjustUI
"
);
},
//初始化游戏
initGame
:
function
()
{
//获得数据
g
.
res_mgr
.
getFormData
();
},
setAABB
(
Id
)
{
var
node
=
this
.
contentArr_1
[
Id
]
let
svLeftBottomPoint
=
node
.
parent
.
convertToWorldSpaceAR
(
cc
.
v2
(
node
.
x
-
node
.
anchorX
*
node
.
width
/
2
,
node
.
y
-
node
.
anchorY
*
node
.
height
/
2
)
);
// 求出 ScrollView 可视区域在世界坐标系中的矩形(碰撞盒)
let
svBBoxRect
=
cc
.
rect
(
svLeftBottomPoint
.
x
-
120
,
svLeftBottomPoint
.
y
-
100
,
node
.
width
,
node
.
height
);
// console.log(Id + ":" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y);
return
svBBoxRect
},
//检查当前缩放倍数
checkScale
:
function
(
num
)
{
var
scale
=
1
;
if
(
num
>
2
&&
num
<=
4
)
{
scale
=
0.74
}
if
(
num
>
4
)
{
scale
=
0.65
}
return
scale
;
},
//添加节点
addItem
:
function
()
{
let
itemArr
=
g
.
data_mgr
.
getSheepArr
();
this
.
idx
=
this
.
checkNodeParent
();
g
.
data_mgr
.
nowNum
=
itemArr
.
length
;
itemArr
.
sort
(
function
()
{
return
Math
.
random
()
>
0.5
?
-
1
:
1
;
})
for
(
var
i
=
0
;
i
<
itemArr
.
length
;
i
++
)
{
let
newItem_0
=
cc
.
instantiate
(
this
.
Item_0
[
itemArr
.
length
>
14
?
0
:
1
]);
//let newItem_1 = cc.instantiate(this.Item_1);
//更新子项
var
com
=
newItem_0
.
getChildByName
(
"
item
"
).
getComponent
(
"
item
"
);
let
itemInfo
=
itemArr
[
i
];
com
.
updateUI
(
itemInfo
);
newItem_0
.
active
=
true
;
// newItem_1.active = true;
//设置类别
let
sheepInfo
=
g
.
data_mgr
.
getSheep
(
i
);
newItem_0
.
getChildByName
(
"
item
"
).
type
=
this
.
checkType
(
sheepInfo
.
sheepfoldId
);
// newItem_1.parent = newItem_0;
// newItem_0.parent = this.contentArr;
// var idx = this.checkNodeParent(i);
newItem_0
.
parent
=
this
.
contentArr_2
[
this
.
idx
];
};
},
//检测放到哪个节点底下
checkNodeParent
:
function
()
{
//获取到总列表
var
itemArr
=
g
.
data_mgr
.
getSheepArr
();
//
if
(
itemArr
.
length
<=
7
)
{
this
.
contentArr_2
[
1
].
active
=
true
;
var
idx
=
1
;
}
else
{
this
.
contentArr_2
[
0
].
active
=
true
;
var
idx
=
0
;
}
return
idx
;
},
//检查类别
checkType
:
function
(
Id
)
{
for
(
var
i
in
g
.
data_mgr
.
getSheepfoldArr
())
{
var
sheepfoldInfo
=
g
.
data_mgr
.
getSheepfoldArr
()[
i
];
if
(
Id
==
sheepfoldInfo
.
id
)
{
return
~~
i
+
1
;
}
}
return
-
1
;
},
//更新界面信息
UpdataUi
:
function
()
{
//设置大标题
this
.
lb_title
.
string
=
g
.
data_mgr
.
getTitle
();
//设置俩个标题
this
.
contentArr_1
[
0
].
getChildByName
(
"
title
"
).
getComponent
(
cc
.
Label
).
string
=
g
.
data_mgr
.
getSheepfold
(
0
).
word
;
//设置俩个标题
this
.
contentArr_1
[
1
].
getChildByName
(
"
title
"
).
getComponent
(
cc
.
Label
).
string
=
g
.
data_mgr
.
getSheepfold
(
1
).
word
;
//重置UI界面
this
.
resetUI
();
//添加项
this
.
addItem
();
// //设置上下页按钮状态
// this.setButtonState();
},
//播放标题音效
playAudioTitle
:
function
()
{
//获得播放路径
var
path
=
g
.
data_mgr
.
data
.
audio_url
;
g
.
res_mgr
.
playAudioByUrl
(
path
,
(
url
)
=>
{
g
.
snd_mgr
.
playEffect
(
url
,
null
);
});
},
//重置UI界面
resetUI
:
function
()
{
//移除所有子节点
this
.
contentArr_2
[
0
].
removeAllChildren
();
this
.
contentArr_2
[
1
].
removeAllChildren
();
this
.
contentArr_1
[
0
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
).
removeAllChildren
();
this
.
contentArr_1
[
1
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
).
removeAllChildren
();
},
//重新开始
onBtnReStart
:
function
()
{
g
.
speaker
.
inst
.
play_btn
();
//移除所有计时器
this
.
unscheduleAllCallbacks
();
//初始化界面
this
.
UpdataUi
();
g
.
speaker
.
inst
.
play_restart
();
},
//游戏开始
gameStart
:
function
()
{
console
.
log
(
"
游戏开始:
"
+
g
.
data_mgr
);
//播放一个上面的音乐
this
.
setAudioInfo
(
1
);
},
//设置上下页按钮状态
setButtonState
:
function
()
{
//先判断题目长度
if
(
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
<
2
)
{
this
.
btnList
[
0
].
node
.
active
=
false
;
this
.
btnList
[
1
].
node
.
active
=
false
;
}
else
{
//如果第一页
if
(
g
.
data_mgr
.
pageId
==
0
)
{
this
.
btnList
[
1
].
node
.
active
=
true
;
this
.
btnList
[
0
].
node
.
active
=
false
;
}
if
(
g
.
data_mgr
.
pageId
==
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
this
.
btnList
[
0
].
node
.
active
=
true
;
this
.
btnList
[
1
].
node
.
active
=
false
;
}
if
(
g
.
data_mgr
.
pageId
>
0
&&
g
.
data_mgr
.
pageId
<
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
-
1
)
{
this
.
btnList
[
0
].
node
.
active
=
true
;
this
.
btnList
[
1
].
node
.
active
=
true
;
}
}
},
//上一关
onBtnLastPage
:
function
()
{
g
.
speaker
.
inst
.
play_btn
();
if
(
g
.
data_mgr
.
pageId
-
1
>=
0
)
{
g
.
data_mgr
.
pageId
-=
1
;
this
.
setButtonState
();
this
.
onBtnReStart
();
}
},
//下一关
onBtnNextPage
:
function
()
{
g
.
speaker
.
inst
.
play_btn
();
if
(
g
.
data_mgr
.
pageId
+
1
<
g
.
data_mgr
.
data
.
contentObj
.
pageArr
.
length
)
{
g
.
data_mgr
.
pageId
+=
1
;
this
.
setButtonState
();
this
.
onBtnReStart
();
}
},
onBtnMask
:
function
()
{
if
(
this
.
isLoadEnd
)
{
this
.
isLoadEnd
=
false
;
g
.
speaker
.
inst
.
play_start
(()
=>
{
setTimeout
(()
=>
{
g
.
game
.
inst
.
playAudioTitle
(()
=>
{
g
.
game
.
inst
.
mask_node
.
active
=
false
;
//游戏开始
g
.
game
.
inst
.
gameStart
();
});
},
500
)
});
}
},
});
play/assets/tmpGame/script/game/item.js
View file @
3599aaa8
...
...
@@ -3,257 +3,257 @@
*/
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
properties
:
{
Item_name
:
{
default
:
null
,
type
:
cc
.
Label
,
displayName
:
"
名字
"
},
Item_redName
:
{
default
:
null
,
type
:
cc
.
Label
,
displayName
:
"
红色名字
"
},
Item_photo
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
图片
"
},
Item_complete
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
完成显示
"
},
},
properties
:
{
Item_name
:
{
default
:
null
,
type
:
cc
.
Label
,
displayName
:
"
名字
"
},
Item_redName
:
{
default
:
null
,
type
:
cc
.
Label
,
displayName
:
"
红色名字
"
},
Item_photo
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
图片
"
},
Item_complete
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
完成显示
"
},
},
start
:
function
()
{
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
touchBegan
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
touchMove
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
touchEnd
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
touchCancel
,
this
);
},
start
:
function
()
{
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
touchBegan
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
touchMove
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
touchEnd
,
this
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_CANCEL
,
this
.
touchCancel
,
this
);
},
//触摸开始
touchBegan
:
function
(
event
)
{
this
.
isMove
=
false
;
this
.
deltaPos
=
this
.
node
.
x
+
this
.
node
.
y
;
},
//触摸开始
touchBegan
:
function
(
event
)
{
this
.
isMove
=
false
;
this
.
deltaPos
=
this
.
node
.
x
+
this
.
node
.
y
;
},
//触摸移动
touchMove
:
function
(
event
)
{
if
(
this
.
node
.
isComplent
||
this
.
_isRotate
)
{
return
}
// var posScreen = event.getLocation(); //点击事件获取位置
// var posNode = this.node.parent.convertToNodeSpaceAR(posScreen);
// var iposTouch = this.getFormatIPos(posNode);
var
delta
=
event
.
getDelta
();
this
.
node
.
x
+=
delta
.
x
;
this
.
node
.
y
+=
delta
.
y
;
//触摸移动
touchMove
:
function
(
event
)
{
if
(
this
.
node
.
isComplent
||
this
.
_isRotate
)
{
return
}
// var posScreen = event.getLocation(); //点击事件获取位置
// var posNode = this.node.parent.convertToNodeSpaceAR(posScreen);
// var iposTouch = this.getFormatIPos(posNode);
var
delta
=
event
.
getDelta
();
this
.
node
.
x
+=
delta
.
x
;
this
.
node
.
y
+=
delta
.
y
;
var
deltaPos
=
this
.
node
.
x
+
this
.
node
.
y
;
if
(
Math
.
abs
(
this
.
deltaPos
-
deltaPos
)
>
10
)
{
this
.
isMove
=
true
;
}
},
var
deltaPos
=
this
.
node
.
x
+
this
.
node
.
y
;
if
(
Math
.
abs
(
this
.
deltaPos
-
deltaPos
)
>
10
)
{
this
.
isMove
=
true
;
}
},
//触摸结束
touchEnd
:
function
(
event
)
{
//获得世界坐标
var
posScreen
=
event
.
getLocation
();
//点击事件获取位置
var
posNode
=
this
.
node
.
convertToNodeSpaceAR
(
posScreen
);
console
.
log
(
"
世界坐标
"
+
posNode
);
//触摸结束
touchEnd
:
function
(
event
)
{
//获得世界坐标
var
posScreen
=
event
.
getLocation
();
//点击事件获取位置
var
posNode
=
this
.
node
.
convertToNodeSpaceAR
(
posScreen
);
console
.
log
(
"
世界坐标
"
+
posNode
);
if
(
!
this
.
isMove
)
{
cc
.
log
(
"
点击了
"
);
this
.
onBtnRotate
();
//回到原来的位置
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
return
}
if
(
!
this
.
isMove
)
{
cc
.
log
(
"
点击了
"
);
this
.
onBtnRotate
();
//回到原来的位置
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
return
}
//获得俩个节点的世界坐标
var
contentArrPos_0
=
g
.
game
.
inst
.
setAABB
(
0
);
var
contentArrPos_1
=
g
.
game
.
inst
.
setAABB
(
1
);
//获得俩个节点的世界坐标
var
contentArrPos_0
=
g
.
game
.
inst
.
setAABB
(
0
);
var
contentArrPos_1
=
g
.
game
.
inst
.
setAABB
(
1
);
// 获取 ScrollView Node 的左下角坐标在世界坐标系中的坐标
let
svLeftBottomPoint
=
this
.
node
.
parent
.
convertToWorldSpaceAR
(
cc
.
v2
(
this
.
node
.
x
-
this
.
node
.
anchorX
*
this
.
node
.
width
,
this
.
node
.
y
-
this
.
node
.
anchorY
*
this
.
node
.
height
)
);
// 获取 ScrollView Node 的左下角坐标在世界坐标系中的坐标
let
svLeftBottomPoint
=
this
.
node
.
parent
.
convertToWorldSpaceAR
(
cc
.
v2
(
this
.
node
.
x
-
this
.
node
.
anchorX
*
this
.
node
.
width
,
this
.
node
.
y
-
this
.
node
.
anchorY
*
this
.
node
.
height
)
);
// 求出 ScrollView 可视区域在世界坐标系中的矩形(碰撞盒)
var
posNode_1
=
cc
.
rect
(
svLeftBottomPoint
.
x
,
svLeftBottomPoint
.
y
,
this
.
node
.
width
,
this
.
node
.
height
);
var
isIntersect_1
=
contentArrPos_1
.
containsRect
(
posNode_1
);
//判断是否被包含
var
isIntersect_0
=
contentArrPos_0
.
containsRect
(
posNode_1
);
// console.log("坐标" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y + "是否包含" + isIntersect_1);
if
(
isIntersect_1
)
{
if
(
this
.
node
.
type
==
1
)
{
this
.
Item_complete
.
active
=
true
;
this
.
node
.
isComplent
=
true
;
g
.
data_mgr
.
nowNum
-=
1
;
if
(
g
.
data_mgr
.
nowNum
==
0
)
{
g
.
effect
.
inst
.
showEffect2
();
}
g
.
speaker
.
inst
.
play_good
();
// 求出 ScrollView 可视区域在世界坐标系中的矩形(碰撞盒)
var
posNode_1
=
cc
.
rect
(
svLeftBottomPoint
.
x
,
svLeftBottomPoint
.
y
,
this
.
node
.
width
,
this
.
node
.
height
);
var
isIntersect_1
=
contentArrPos_1
.
containsRect
(
posNode_1
);
//判断是否被包含
var
isIntersect_0
=
contentArrPos_0
.
containsRect
(
posNode_1
);
// console.log("坐标" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y + "是否包含" + isIntersect_1);
if
(
isIntersect_1
)
{
if
(
this
.
node
.
type
==
2
)
{
this
.
Item_complete
.
active
=
true
;
this
.
node
.
isComplent
=
true
;
g
.
data_mgr
.
nowNum
-=
1
;
if
(
g
.
data_mgr
.
nowNum
==
0
)
{
g
.
effect
.
inst
.
showEffect2
();
}
g
.
speaker
.
inst
.
play_good
();
var
newItem_temp
=
cc
.
instantiate
(
g
.
game
.
inst
.
Item_0
[
2
]);
var
newItem_temp
=
cc
.
instantiate
(
g
.
game
.
inst
.
Item_0
[
2
]);
g
.
game
.
inst
.
contentArr_1
[
1
].
getChildByName
(
"
db
"
).
active
=
true
;
g
.
game
.
inst
.
contentArr_1
[
1
].
getChildByName
(
"
db
"
).
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
"
newAnimation
"
,
1
);
if
(
this
.
node
.
width
>=
150
)
{
this
.
node
.
scale
=
0.666
;
this
.
node
.
x
=
0
;
}
g
.
game
.
inst
.
contentArr_1
[
1
].
getChildByName
(
"
db
"
).
active
=
true
;
g
.
game
.
inst
.
contentArr_1
[
1
].
getChildByName
(
"
db
"
).
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
"
newAnimation
"
,
1
);
if
(
this
.
node
.
width
>=
150
)
{
this
.
node
.
scale
=
0.666
;
this
.
node
.
x
=
0
;
}
this
.
node
.
parent
=
newItem_temp
;
newItem_temp
.
parent
=
g
.
game
.
inst
.
contentArr_1
[
1
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
);
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
}
else
{
this
.
errorEffect
();
}
console
.
log
(
"
被1包含
"
+
isIntersect_1
);
}
else
if
(
isIntersect_0
)
{
if
(
this
.
node
.
type
==
2
)
{
this
.
Item_complete
.
active
=
true
;
this
.
node
.
isComplent
=
true
;
g
.
data_mgr
.
nowNum
-=
1
;
if
(
g
.
data_mgr
.
nowNum
==
0
)
{
g
.
effect
.
inst
.
showEffect2
();
}
g
.
speaker
.
inst
.
play_good
();
this
.
node
.
parent
=
newItem_temp
;
newItem_temp
.
parent
=
g
.
game
.
inst
.
contentArr_1
[
1
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
);
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
}
else
{
this
.
errorEffect
();
}
console
.
log
(
"
被1包含
"
+
isIntersect_1
);
}
else
if
(
isIntersect_0
)
{
if
(
this
.
node
.
type
==
1
)
{
this
.
Item_complete
.
active
=
true
;
this
.
node
.
isComplent
=
true
;
g
.
data_mgr
.
nowNum
-=
1
;
if
(
g
.
data_mgr
.
nowNum
==
0
)
{
g
.
effect
.
inst
.
showEffect2
();
}
g
.
speaker
.
inst
.
play_good
();
var
newItem_temp
=
cc
.
instantiate
(
g
.
game
.
inst
.
Item_0
[
2
]);
var
newItem_temp
=
cc
.
instantiate
(
g
.
game
.
inst
.
Item_0
[
2
]);
g
.
game
.
inst
.
contentArr_1
[
0
].
getChildByName
(
"
db
"
).
active
=
true
;
g
.
game
.
inst
.
contentArr_1
[
0
].
getChildByName
(
"
db
"
).
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
"
newAnimation
"
,
1
);
if
(
this
.
node
.
width
>=
150
)
{
this
.
node
.
scale
=
0.666
;
this
.
node
.
x
=
0
;
}
this
.
node
.
parent
=
newItem_temp
;
newItem_temp
.
parent
=
g
.
game
.
inst
.
contentArr_1
[
0
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
);
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
console
.
log
(
"
被2包含
"
+
isIntersect_0
);
}
else
{
this
.
errorEffect
();
}
}
else
{
//回到原来的位置
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
}
},
g
.
game
.
inst
.
contentArr_1
[
0
].
getChildByName
(
"
db
"
).
active
=
true
;
g
.
game
.
inst
.
contentArr_1
[
0
].
getChildByName
(
"
db
"
).
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
"
newAnimation
"
,
1
);
if
(
this
.
node
.
width
>=
150
)
{
this
.
node
.
scale
=
0.666
;
this
.
node
.
x
=
0
;
}
this
.
node
.
parent
=
newItem_temp
;
newItem_temp
.
parent
=
g
.
game
.
inst
.
contentArr_1
[
0
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
);
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
console
.
log
(
"
被2包含
"
+
isIntersect_0
);
}
else
{
this
.
errorEffect
();
}
}
else
{
//回到原来的位置
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
}
},
errorEffect
:
function
()
{
g
.
speaker
.
inst
.
play_error
();
errorEffect
:
function
()
{
g
.
speaker
.
inst
.
play_error
();
this
.
node
.
getChildByName
(
"
red
"
).
active
=
true
;
cc
.
tween
(
this
.
node
)
.
to
(
0.1
,
{
scaleY
:
0.9
,
scaleX
:
1.1
})
.
to
(
0.15
,
{
scaleY
:
1.1
,
scaleX
:
0.9
})
.
to
(
0.1
,
{
scaleY
:
1
,
scaleX
:
1
})
.
start
()
setTimeout
(()
=>
{
this
.
node
.
getChildByName
(
"
red
"
).
active
=
false
;
//回到原来的位置
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
},
500
)
},
this
.
node
.
getChildByName
(
"
red
"
).
active
=
true
;
cc
.
tween
(
this
.
node
)
.
to
(
0.1
,
{
scaleY
:
0.9
,
scaleX
:
1.1
})
.
to
(
0.15
,
{
scaleY
:
1.1
,
scaleX
:
0.9
})
.
to
(
0.1
,
{
scaleY
:
1
,
scaleX
:
1
})
.
start
()
setTimeout
(()
=>
{
this
.
node
.
getChildByName
(
"
red
"
).
active
=
false
;
//回到原来的位置
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
},
500
)
},
//触摸取消
touchCancel
:
function
(
event
)
{
//回到原来的位置
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
//触摸取消
touchCancel
:
function
(
event
)
{
//回到原来的位置
this
.
node
.
x
=
0
;
this
.
node
.
y
=
0
;
this
.
isMove
=
false
;
},
this
.
isMove
=
false
;
},
//更新界面ui
updateUI
:
function
(
Info
)
{
//当前数据
this
.
itemInfo
=
Info
;
//更新界面ui
updateUI
:
function
(
Info
)
{
//当前数据
this
.
itemInfo
=
Info
;
//初始化数据
this
.
InitData
();
//初始化数据
this
.
InitData
();
//是否已经完成了
this
.
node
.
isComplent
=
false
;
},
//是否已经完成了
this
.
node
.
isComplent
=
false
;
},
//点击翻面
onBtnRotate
:
function
()
{
//翻面音效
g
.
speaker
.
inst
.
play_btn
();
//点击翻面
onBtnRotate
:
function
()
{
//翻面音效
g
.
speaker
.
inst
.
play_btn
();
var
scaleX
=
this
.
node
.
scaleY
;
var
scaleX
=
this
.
node
.
scaleY
;
this
.
_isRotate
=
true
;
setTimeout
(()
=>
{
this
.
_isRotate
=
false
;
},
600
)
this
.
_isRotate
=
true
;
setTimeout
(()
=>
{
this
.
_isRotate
=
false
;
},
600
)
cc
.
tween
(
this
.
node
)
.
to
(
0.3
,
{
scaleX
:
0
})
.
call
(()
=>
{
if
(
this
.
Item_name
.
node
.
active
)
{
this
.
Item_name
.
node
.
active
=
false
;
this
.
Item_photo
.
active
=
true
;
this
.
Item_redName
.
node
.
active
=
false
;
}
else
{
this
.
Item_name
.
node
.
active
=
true
;
this
.
Item_photo
.
active
=
false
;
this
.
Item_redName
.
node
.
active
=
true
;
}
})
.
to
(
0.3
,
{
scaleX
:
scaleX
})
.
start
();
},
cc
.
tween
(
this
.
node
)
.
to
(
0.3
,
{
scaleX
:
0
})
.
call
(()
=>
{
if
(
this
.
Item_name
.
node
.
active
)
{
this
.
Item_name
.
node
.
active
=
false
;
this
.
Item_photo
.
active
=
true
;
this
.
Item_redName
.
node
.
active
=
false
;
}
else
{
this
.
Item_name
.
node
.
active
=
true
;
this
.
Item_photo
.
active
=
false
;
this
.
Item_redName
.
node
.
active
=
true
;
}
})
.
to
(
0.3
,
{
scaleX
:
scaleX
})
.
start
();
},
//初始化信息
InitData
:
function
()
{
//设置图片
g
.
res_mgr
.
getSpriteFrimeByUrl
(
this
.
itemInfo
.
picUrl
,
(
list
)
=>
{
this
.
Item_photo
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
list
;
this
.
photoScare
(
this
.
Item_photo
,
g
.
game
.
inst
.
idx
);
// this.photoScare(this.nodeState[2].getChildByName("spt_item"), 1);
});
//设置名字
this
.
Item_name
.
string
=
this
.
itemInfo
.
word
;
//设置红色名字
this
.
Item_redName
.
string
=
this
.
itemInfo
.
word
;
},
//初始化信息
InitData
:
function
()
{
//设置图片
g
.
res_mgr
.
getSpriteFrimeByUrl
(
this
.
itemInfo
.
picUrl
,
(
list
)
=>
{
this
.
Item_photo
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
list
;
this
.
photoScare
(
this
.
Item_photo
,
g
.
game
.
inst
.
idx
);
// this.photoScare(this.nodeState[2].getChildByName("spt_item"), 1);
});
//设置名字
this
.
Item_name
.
string
=
this
.
itemInfo
.
word
;
//设置红色名字
this
.
Item_redName
.
string
=
this
.
itemInfo
.
word
;
},
//图片适配
photoScare
:
function
(
node
,
type
)
{
var
maxNum
=
type
==
0
?
50
:
75
;
let
maxSize
=
Math
.
min
(
maxNum
/
node
.
height
,
maxNum
/
node
.
width
);
if
(
node
.
perScale
==
undefined
)
{
node
.
perScale
=
node
.
scaleX
;
}
else
{
node
.
scaleX
=
node
.
perScale
;
node
.
scaleY
=
node
.
perScale
;
}
node
.
scaleX
*=
maxSize
;
node
.
scaleY
*=
maxSize
;
},
//图片适配
photoScare
:
function
(
node
,
type
)
{
var
maxNum
=
type
==
0
?
50
:
75
;
let
maxSize
=
Math
.
min
(
maxNum
/
node
.
height
,
maxNum
/
node
.
width
);
if
(
node
.
perScale
==
undefined
)
{
node
.
perScale
=
node
.
scaleX
;
}
else
{
node
.
scaleX
=
node
.
perScale
;
node
.
scaleY
=
node
.
perScale
;
}
node
.
scaleX
*=
maxSize
;
node
.
scaleY
*=
maxSize
;
},
});
play/assets/tmpGame/script/manager/data_mgr.js
View file @
3599aaa8
...
...
@@ -13,7 +13,8 @@ g.data_mgr = {
{
"
id
"
:
"
162373800016117r8ti
"
,
"
word
"
:
"
标题1
"
},
{
"
id
"
:
"
1623738000162o9u566
"
,
"
word
"
:
"
标题2
"
}],
"
sheepArr
"
:
[{
"
sheepfoldId
"
:
"
162373800016117r8ti
"
,
"
word
"
:
"
aaa
"
,
"
picUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/77d34b5a7f2895e9319d4485a84a1b2b.png
"
},
{
"
word
"
:
"
aa
"
,
"
sheepfoldId
"
:
"
1623738000162o9u566
"
,
"
picUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/be3debcc0598cfdde8a9e1ad2324743e.png
"
},
{
"
sheepfoldId
"
:
"
1623738000162o9u566
"
,
"
picUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/be3debcc0598cfdde8a9e1ad2324743e.png
"
,
"
word
"
:
"
fgsdfg
"
},
{
"
sheepfoldId
"
:
"
162373800016117r8ti
"
,
"
picUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/77d34b5a7f2895e9319d4485a84a1b2b.png
"
,
"
word
"
:
"
gdfa
"
}],
"
title
"
:
"
asdfa
"
"
title
"
:
"
asdfa
"
,
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/032ce2b956871f7bc7b200d0ebbb7afc.mp3
"
}
const
data
=
dataJson
;
// const data = JSON.parse(dataJson);
...
...
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