Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cake_template_test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
cake_template_test
Commits
afc17203
Commit
afc17203
authored
Mar 12, 2022
by
杨一航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: done
parent
9935700b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
815 additions
and
107 deletions
+815
-107
CakeBar.ts
assets/cake_template_test/prefabs/CakeBar.ts
+4
-0
Candle.ts
assets/cake_template_test/prefabs/Candle.ts
+4
-0
cakeBar.prefab
assets/cake_template_test/prefabs/cakeBar.prefab
+8
-8
cake_template_test.fire
assets/cake_template_test/scene/cake_template_test.fire
+635
-84
cake_template_test.ts
assets/cake_template_test/scene/cake_template_test.ts
+121
-15
defaultData.ts
assets/cake_template_test/script/defaultData.ts
+43
-0
No files found.
assets/cake_template_test/prefabs/CakeBar.ts
View file @
afc17203
...
@@ -23,6 +23,10 @@ export default class CakeBar extends cc.Component {
...
@@ -23,6 +23,10 @@ export default class CakeBar extends cc.Component {
node
.
getChildByName
(
"
fall
"
).
active
=
state
==
2
;
node
.
getChildByName
(
"
fall
"
).
active
=
state
==
2
;
node
.
getChildByName
(
"
in
"
).
active
=
state
==
0
;
node
.
getChildByName
(
"
in
"
).
active
=
state
==
0
;
node
.
getChildByName
(
"
done
"
).
active
=
state
==
1
;
node
.
getChildByName
(
"
done
"
).
active
=
state
==
1
;
if
(
state
==
1
)
{
node
.
opacity
=
0
;
cc
.
tween
(
node
).
to
(
0.5
,
{
opacity
:
127
,
scale
:
1.2
}).
to
(
0.5
,
{
opacity
:
255
,
scale
:
1
}).
start
();
}
}
}
...
...
assets/cake_template_test/prefabs/Candle.ts
View file @
afc17203
...
@@ -41,7 +41,11 @@ export default class Candle extends cc.Component {
...
@@ -41,7 +41,11 @@ export default class Candle extends cc.Component {
}
}
setSkin
(
type
:
number
)
{
setSkin
(
type
:
number
)
{
this
.
node
.
active
=
true
;
this
.
fire
.
node
.
active
=
true
;
this
.
fireEnd
.
node
.
active
=
false
;
this
.
proBar
.
barSprite
.
spriteFrame
=
this
.
skin
[
type
];
this
.
proBar
.
barSprite
.
spriteFrame
=
this
.
skin
[
type
];
this
.
proBar
.
progress
=
1
;
}
}
fireOn
(
time
:
number
,
endCall
)
{
fireOn
(
time
:
number
,
endCall
)
{
...
...
assets/cake_template_test/prefabs/cakeBar.prefab
View file @
afc17203
...
@@ -43,12 +43,12 @@
...
@@ -43,12 +43,12 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 3
00
,
"width": 3
4
,
"height": 50
"height": 50
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
0
,
"x":
1
,
"y": 0.5
"y": 0.5
},
},
"_trs": {
"_trs": {
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
17,
-
17,
0,
0,
0,
0,
0,
0,
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
"__id__": 2
"__id__": 2
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 4
"__id__": 4
...
@@ -269,7 +269,7 @@
...
@@ -269,7 +269,7 @@
"__id__": 2
"__id__": 2
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 7
"__id__": 7
...
@@ -376,7 +376,7 @@
...
@@ -376,7 +376,7 @@
"__id__": 2
"__id__": 2
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 10
"__id__": 10
...
@@ -528,10 +528,10 @@
...
@@ -528,10 +528,10 @@
"_enabled": true,
"_enabled": true,
"_layoutSize": {
"_layoutSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 3
00
,
"width": 3
4
,
"height": 50
"height": 50
},
},
"_resize":
0
,
"_resize":
1
,
"_N$layoutType": 1,
"_N$layoutType": 1,
"_N$cellSize": {
"_N$cellSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
...
...
assets/cake_template_test/scene/cake_template_test.fire
View file @
afc17203
...
@@ -78,46 +78,49 @@
...
@@ -78,46 +78,49 @@
"__id__": 7
"__id__": 7
},
},
{
{
"__id__": 1
5
"__id__": 1
9
},
},
{
{
"__id__": 2
1
"__id__": 2
5
},
},
{
{
"__id__":
26
"__id__":
30
},
},
{
{
"__id__": 3
5
"__id__": 3
9
},
},
{
{
"__id__":
36
"__id__":
40
},
},
{
{
"__id__":
37
"__id__":
41
},
},
{
{
"__id__": 4
1
"__id__": 4
5
},
},
{
{
"__id__": 4
3
"__id__": 4
7
},
},
{
{
"__id__": 4
5
"__id__": 4
9
},
},
{
{
"__id__": 47
"__id__": 51
},
{
"__id__": 55
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
51
"__id__":
62
},
},
{
{
"__id__":
52
"__id__":
63
},
},
{
{
"__id__":
53
"__id__":
64
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -376,15 +379,18 @@
...
@@ -376,15 +379,18 @@
},
},
{
{
"__id__": 12
"__id__": 12
},
{
"__id__": 13
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 1
3
"__id__": 1
7
},
},
{
{
"__id__": 1
4
"__id__": 1
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -443,7 +449,7 @@
...
@@ -443,7 +449,7 @@
"__id__": 7
"__id__": 7
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 9
"__id__": 9
...
@@ -658,6 +664,187 @@
...
@@ -658,6 +664,187 @@
"groupIndex": 0,
"groupIndex": 0,
"_id": "88aic1F49FXI4/g4cEl9+f"
"_id": "88aic1F49FXI4/g4cEl9+f"
},
},
{
"__type__": "cc.Node",
"_name": "answer",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 14
},
{
"__id__": 15
},
{
"__id__": 16
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 149,
"height": 88
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
500,
30,
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": "a9YQWmOthEqKuFYLycVrv0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d5d1ee58-241c-4d9a-8c7d-a550d6fd2690"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ad2OTmmiBDkpTJTDWcfwSW"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "41T2+NU6tKrrO8MiO/a43Q"
},
{
"__type__": "38a22FB72FKLZarwAivSQnN",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"clickAudio": {
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b"
},
"_id": "2fzNGTOe5BsKzTMUiO6v9O"
},
{
{
"__type__": "cc.Sprite",
"__type__": "cc.Sprite",
"_name": "",
"_name": "",
...
@@ -726,16 +913,16 @@
...
@@ -726,16 +913,16 @@
},
},
"_children": [
"_children": [
{
{
"__id__":
16
"__id__":
20
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
19
"__id__":
23
},
},
{
{
"__id__": 2
0
"__id__": 2
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -791,16 +978,16 @@
...
@@ -791,16 +978,16 @@
"_name": "lb",
"_name": "lb",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
5
"__id__": 1
9
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
17
"__id__":
21
},
},
{
{
"__id__":
18
"__id__":
22
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -856,7 +1043,7 @@
...
@@ -856,7 +1043,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
16
"__id__":
20
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -891,7 +1078,7 @@
...
@@ -891,7 +1078,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
16
"__id__":
20
},
},
"_enabled": true,
"_enabled": true,
"_color": {
"_color": {
...
@@ -909,7 +1096,7 @@
...
@@ -909,7 +1096,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
5
"__id__": 1
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -941,7 +1128,7 @@
...
@@ -941,7 +1128,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 1
5
"__id__": 1
9
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -972,13 +1159,13 @@
...
@@ -972,13 +1159,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 2
2
"__id__": 2
6
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 2
5
"__id__": 2
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1034,16 +1221,16 @@
...
@@ -1034,16 +1221,16 @@
"_name": "lb_word",
"_name": "lb_word",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
1
"__id__": 2
5
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 2
3
"__id__": 2
7
},
},
{
{
"__id__": 2
4
"__id__": 2
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1099,7 +1286,7 @@
...
@@ -1099,7 +1286,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
2
"__id__": 2
6
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1134,7 +1321,7 @@
...
@@ -1134,7 +1321,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
2
"__id__": 2
6
},
},
"_enabled": true,
"_enabled": true,
"_color": {
"_color": {
...
@@ -1152,7 +1339,7 @@
...
@@ -1152,7 +1339,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
1
"__id__": 2
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1188,13 +1375,13 @@
...
@@ -1188,13 +1375,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__":
27
"__id__":
31
}
}
],
],
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 3
4
"__id__": 3
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1250,20 +1437,20 @@
...
@@ -1250,20 +1437,20 @@
"_name": "evaluation_bg",
"_name": "evaluation_bg",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
26
"__id__":
30
},
},
"_children": [
"_children": [
{
{
"__id__":
28
"__id__":
32
},
},
{
{
"__id__":
29
"__id__":
33
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
3
"__id__": 3
7
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1319,7 +1506,7 @@
...
@@ -1319,7 +1506,7 @@
"_name": "center",
"_name": "center",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
27
"__id__":
31
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
...
@@ -1377,19 +1564,19 @@
...
@@ -1377,19 +1564,19 @@
"_name": "centerBtn",
"_name": "centerBtn",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
27
"__id__":
31
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
0
"__id__": 3
4
},
},
{
{
"__id__": 3
1
"__id__": 3
5
},
},
{
{
"__id__": 3
2
"__id__": 3
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1445,7 +1632,7 @@
...
@@ -1445,7 +1632,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
29
"__id__":
33
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -1472,7 +1659,7 @@
...
@@ -1472,7 +1659,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
29
"__id__":
33
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -1540,7 +1727,7 @@
...
@@ -1540,7 +1727,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
29
"__id__":
33
},
},
"_enabled": true,
"_enabled": true,
"clickAudio": {
"clickAudio": {
...
@@ -1553,7 +1740,7 @@
...
@@ -1553,7 +1740,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
27
"__id__":
31
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1585,7 +1772,7 @@
...
@@ -1585,7 +1772,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
26
"__id__":
30
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1739,13 +1926,13 @@
...
@@ -1739,13 +1926,13 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__":
38
"__id__":
42
},
},
{
{
"__id__":
39
"__id__":
43
},
},
{
{
"__id__": 4
0
"__id__": 4
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1801,7 +1988,7 @@
...
@@ -1801,7 +1988,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
37
"__id__":
41
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1833,7 +2020,7 @@
...
@@ -1833,7 +2020,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
37
"__id__":
41
},
},
"_enabled": true,
"_enabled": true,
"_id": "01+Y/GzuFOHJLQR+96yvFP"
"_id": "01+Y/GzuFOHJLQR+96yvFP"
...
@@ -1843,7 +2030,7 @@
...
@@ -1843,7 +2030,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
37
"__id__":
41
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -1876,7 +2063,7 @@
...
@@ -1876,7 +2063,7 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 4
2
"__id__": 4
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1890,19 +2077,19 @@
...
@@ -1890,19 +2077,19 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
10
0,
"width": 0,
"height": 30
"height": 30
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
0
,
"x":
1
,
"y": 0.5
"y": 0.5
},
},
"_trs": {
"_trs": {
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
4
90,
5
90,
325,
325,
0,
0,
0,
0,
...
@@ -1932,7 +2119,7 @@
...
@@ -1932,7 +2119,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
1
"__id__": 4
5
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -1965,7 +2152,7 @@
...
@@ -1965,7 +2152,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 4
4
"__id__": 4
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2021,7 +2208,7 @@
...
@@ -2021,7 +2208,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
3
"__id__": 4
7
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2067,7 +2254,7 @@
...
@@ -2067,7 +2254,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__":
46
"__id__":
50
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2123,7 +2310,7 @@
...
@@ -2123,7 +2310,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
5
"__id__": 4
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2161,13 +2348,13 @@
...
@@ -2161,13 +2348,13 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
48
"__id__":
52
},
},
{
{
"__id__":
49
"__id__":
53
},
},
{
{
"__id__": 5
0
"__id__": 5
4
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2223,7 +2410,7 @@
...
@@ -2223,7 +2410,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
47
"__id__":
51
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2255,7 +2442,7 @@
...
@@ -2255,7 +2442,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
47
"__id__":
51
},
},
"_enabled": true,
"_enabled": true,
"_normalMaterial": null,
"_normalMaterial": null,
...
@@ -2323,7 +2510,7 @@
...
@@ -2323,7 +2510,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
47
"__id__":
51
},
},
"_enabled": true,
"_enabled": true,
"clickAudio": {
"clickAudio": {
...
@@ -2331,6 +2518,364 @@
...
@@ -2331,6 +2518,364 @@
},
},
"_id": "89hAyk/zpNO5O7CWQX8kAj"
"_id": "89hAyk/zpNO5O7CWQX8kAj"
},
},
{
"__type__": "cc.Node",
"_name": "endRoot",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 56
},
{
"__id__": 58
},
{
"__id__": 60
}
],
"_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": "5bfaAyxhFEu6nRH/BP8/dT"
},
{
"__type__": "cc.Node",
"_name": "flower",
"_objFlags": 0,
"_parent": {
"__id__": 55
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 57
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1156,
"height": 652
},
"_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": "c7qe8vf+9DYL4ZnplXzSkb"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 56
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": 0,
"premultipliedAlpha": false,
"_armatureKey": "16fac01c-a92c-41ea-a58f-9d4e1c45c5f4#f3d4a96e-162e-4eae-b189-89c65a265ff3",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "16fac01c-a92c-41ea-a58f-9d4e1c45c5f4"
},
"_N$dragonAtlasAsset": {
"__uuid__": "f3d4a96e-162e-4eae-b189-89c65a265ff3"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "adiV7KrD5OOJ1z7Fs3X7rD"
},
{
"__type__": "cc.Node",
"_name": "nicetry",
"_objFlags": 0,
"_parent": {
"__id__": 55
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 59
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 779,
"height": 350
},
"_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": "2dvGIL/+1I15aFDSFgS745"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 58
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "9b6da2ce-b57a-4359-be31-f2650a8d70f5"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "7f7EjCiOdIDpKK23X9067m"
},
{
"__type__": "cc.Node",
"_name": "comeon",
"_objFlags": 0,
"_parent": {
"__id__": 55
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 61
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 199
},
"_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": "d9ogXrX3NCiZAofMzeJUbS"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "3f321347-a19d-4bc7-afaa-72188d163811"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "256aRFvaVB1bfa6G8VoJAX"
},
{
{
"__type__": "cc.Canvas",
"__type__": "cc.Canvas",
"_name": "",
"_name": "",
...
@@ -2399,49 +2944,55 @@
...
@@ -2399,49 +2944,55 @@
"__uuid__": "72e10335-6d78-426b-b387-5442c05cc4bc"
"__uuid__": "72e10335-6d78-426b-b387-5442c05cc4bc"
},
},
"cover": {
"cover": {
"__id__":
37
"__id__":
41
},
},
"title": {
"title": {
"__id__":
17
"__id__":
21
},
},
"startNode": {
"startNode": {
"__id__": 5
0
"__id__": 5
4
},
},
"audioRoot": {
"audioRoot": {
"__id__": 10
"__id__": 10
},
},
"answerNode": {
"__id__": 16
},
"cakrBarRoot": {
"cakrBarRoot": {
"__id__": 4
1
"__id__": 4
5
},
},
"cakeRoot": {
"cakeRoot": {
"__id__": 2
1
"__id__": 2
5
},
},
"candleRoot": {
"candleRoot": {
"__id__": 12
"__id__": 12
},
},
"endRoot": {
"__id__": 55
},
"tvRoot": {
"tvRoot": {
"__id__":
26
"__id__":
30
},
},
"tvCenter": {
"tvCenter": {
"__id__":
28
"__id__":
32
},
},
"tvCenterBtn": {
"tvCenterBtn": {
"__id__": 3
2
"__id__": 3
6
},
},
"excellent": {
"excellent": {
"__id__": 4
4
"__id__": 4
8
},
},
"nictTry": {
"nictTry": {
"__id__": 4
5
"__id__": 4
9
},
},
"lb_word": {
"lb_word": {
"__id__": 2
3
"__id__": 2
7
},
},
"choseARoot": {
"choseARoot": {
"__id__": 3
5
"__id__": 3
9
},
},
"choseBRoot": {
"choseBRoot": {
"__id__":
36
"__id__":
40
},
},
"cakePiece": {
"cakePiece": {
"__id__": 8
"__id__": 8
...
...
assets/cake_template_test/scene/cake_template_test.ts
View file @
afc17203
...
@@ -7,6 +7,7 @@ import ChoseNode from "../prefabs/choseNode";
...
@@ -7,6 +7,7 @@ import ChoseNode from "../prefabs/choseNode";
import
CakeBar
from
"
../prefabs/CakeBar
"
;
import
CakeBar
from
"
../prefabs/CakeBar
"
;
import
AudioBar
from
"
../prefabs/AudioBar
"
;
import
AudioBar
from
"
../prefabs/AudioBar
"
;
import
Candle
from
"
../prefabs/Candle
"
;
import
Candle
from
"
../prefabs/Candle
"
;
import
{
delayCall
}
from
"
../../../form_angular/src/app/play/Unit
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
@
ccclass
...
@@ -40,6 +41,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -40,6 +41,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
audioRoot
:
cc
.
Node
=
null
audioRoot
:
cc
.
Node
=
null
@
property
(
AudioButton
)
answerNode
:
AudioButton
=
null
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
cakrBarRoot
:
cc
.
Node
=
null
cakrBarRoot
:
cc
.
Node
=
null
...
@@ -49,6 +53,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -49,6 +53,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
candleRoot
:
cc
.
Node
=
null
candleRoot
:
cc
.
Node
=
null
@
property
(
cc
.
Node
)
endRoot
:
cc
.
Node
=
null
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
tvRoot
:
cc
.
Node
=
null
tvRoot
:
cc
.
Node
=
null
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
...
@@ -59,7 +66,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -59,7 +66,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
dragonBones
.
ArmatureDisplay
)
@
property
(
dragonBones
.
ArmatureDisplay
)
excellent
:
dragonBones
.
ArmatureDisplay
=
null
;
excellent
:
dragonBones
.
ArmatureDisplay
=
null
;
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
nictTry
:
cc
.
Node
=
null
;
nictTry
:
cc
.
Node
=
null
;
...
@@ -92,6 +98,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -92,6 +98,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
_txtAni
:
cc
.
Node
;
private
_txtAni
:
cc
.
Node
;
private
_candle
:
Candle
;
private
_candle
:
Candle
;
private
_coursewareDone
:
boolean
;
private
_coursewareDone
:
boolean
;
private
_wrongQuestion
:
number
;
...
@@ -122,6 +129,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -122,6 +129,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 所有全局变量 默认都是null
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
this
.
_cantouch
=
true
;
this
.
_totalQuestion
=
defaultData
.
questions
.
length
;
this
.
_totalQuestion
=
defaultData
.
questions
.
length
;
this
.
_wrongQuestion
=
0
;
await
new
Promise
((
resolve
)
=>
{
await
new
Promise
((
resolve
)
=>
{
cc
.
assetManager
.
loadBundle
(
"
cake_template_test
"
,
(
ero
)
=>
{
cc
.
assetManager
.
loadBundle
(
"
cake_template_test
"
,
(
ero
)
=>
{
...
@@ -152,6 +160,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -152,6 +160,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
candleRoot
.
active
=
false
;
this
.
candleRoot
.
active
=
false
;
this
.
excellent
.
node
.
active
=
false
;
this
.
excellent
.
node
.
active
=
false
;
this
.
nictTry
.
active
=
false
;
this
.
nictTry
.
active
=
false
;
this
.
answerNode
.
node
.
active
=
false
;
}
}
pic1
=
null
;
pic1
=
null
;
...
@@ -209,6 +218,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -209,6 +218,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initBtn
()
{
initBtn
()
{
this
.
startNode
.
onceClick
(
this
.
_startAndRemoveCover
,
this
);
this
.
startNode
.
onceClick
(
this
.
_startAndRemoveCover
,
this
);
this
.
tvCenterBtn
.
onClick
(
this
.
_replayAni
,
this
);
this
.
tvCenterBtn
.
onClick
(
this
.
_replayAni
,
this
);
this
.
answerNode
.
onClick
(
this
.
_answerNow
,
this
);
}
}
async
_startAndRemoveCover
()
{
async
_startAndRemoveCover
()
{
cc
.
tween
(
this
.
startNode
.
node
).
delay
(
0.2
).
hide
().
start
();
cc
.
tween
(
this
.
startNode
.
node
).
delay
(
0.2
).
hide
().
start
();
...
@@ -237,7 +247,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -237,7 +247,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
this
.
_nowData
=
defaultData
.
questions
[
this
.
_questionIndex
];
this
.
_nowData
=
defaultData
.
questions
[
this
.
_questionIndex
];
this
.
_cakeBar
.
updateUI
(
this
.
_questionIndex
,
0
);
this
.
initNodes
(
this
.
_nowData
);
this
.
initNodes
(
this
.
_nowData
);
// this.testDragonB();
// this.testDragonB();
...
@@ -260,6 +269,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -260,6 +269,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
rightLetter
:
string
=
data
.
rightLetter
;
let
rightLetter
:
string
=
data
.
rightLetter
;
let
wrongLetter
:
string
=
data
.
wrongLetter
;
let
wrongLetter
:
string
=
data
.
wrongLetter
;
this
.
_nowRightLetter
=
rightLetter
;
this
.
_nowRightLetter
=
rightLetter
;
this
.
answerNode
.
node
.
x
=
cc
.
winSize
.
width
this
.
lb_word
.
string
=
word
;
this
.
lb_word
.
string
=
word
;
if
(
!
this
.
_cake
)
{
if
(
!
this
.
_cake
)
{
...
@@ -300,15 +310,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -300,15 +310,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
audioRoot
.
active
=
true
;
this
.
audioRoot
.
active
=
true
;
cc
.
tween
(
this
.
audioRoot
).
to
(
0.5
,
{
x
:
550
,
y
:
30
}).
start
();
cc
.
tween
(
this
.
audioRoot
).
to
(
0.5
,
{
x
:
550
,
y
:
30
}).
start
();
this
.
setCandelBar
(
0
)
cc
.
tween
(
this
.
candleRoot
).
to
(
0.5
,
{
x
:
-
550
}).
call
(()
=>
{
cc
.
tween
(
this
.
candleRoot
).
to
(
0.5
,
{
x
:
-
550
}).
call
(()
=>
{
this
.
_candle
.
fireOn
(
this
.
_nowData
.
choosewaitTime
,
this
.
_choseTimeOut
.
bind
(
this
));
this
.
_candle
.
fireOn
(
this
.
_nowData
.
choosewaitTime
,
this
.
_choseTimeOut
.
bind
(
this
));
this
.
cover
.
active
=
false
;
this
.
cover
.
active
=
false
;
}).
start
();
}).
start
();
})
})
}
}
async
_choseTimeOut
()
{
if
(
!
this
.
_canAnswer
)
return
;
this
.
_canAnswer
=
false
;
_choseTimeOut
()
{
this
.
cakePiece
.
active
=
true
;
console
.
log
(
"
_choseTimeOut
"
);
this
.
setCandelBar
(
2
);
asyncTweenTo
(
this
.
candleRoot
,
0.5
,
{
x
:
-
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
audioRoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
choseARoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
await
asyncTweenTo
(
this
.
choseBRoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
this
.
nextStep
(
false
)
}
}
async
_onClickAnswer
(
node
,
isAnswer
:
boolean
)
{
async
_onClickAnswer
(
node
,
isAnswer
:
boolean
)
{
...
@@ -322,21 +345,31 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -322,21 +345,31 @@ export default class SceneComponent extends MyCocosSceneComponent {
await
asyncTweenTo
(
node
.
parent
,
0.3
,
{
x
:
0
,
y
:
-
100
})
await
asyncTweenTo
(
node
.
parent
,
0.3
,
{
x
:
0
,
y
:
-
100
})
node
.
active
=
false
;
node
.
active
=
false
;
this
.
_cake
.
insert
(
this
.
_nowRightLetter
,
this
.
_nowRightIndex
);
this
.
_cake
.
insert
(
this
.
_nowRightLetter
,
this
.
_nowRightIndex
);
this
.
_cakeBar
.
updateUI
(
this
.
_questionIndex
,
1
);
await
asyncDelay
(
1
);
await
asyncDelay
(
3
);
}
else
{
}
else
{
this
.
_candle
.
fireStop
();
await
this
.
playLocalAudio
(
"
effect_cake_drop
"
,
true
);
await
this
.
playLocalAudio
(
"
effect_cake_drop
"
,
true
);
await
asyncTweenTo
(
node
.
parent
,
0.18
,
{
x
:
200
,
y
:
-
300
})
//
await asyncTweenTo(node.parent, 0.18, { x: 200, y: -300 })
node
.
active
=
false
;
node
.
active
=
false
;
this
.
cakePiece
.
active
=
true
;
this
.
cakePiece
.
active
=
true
;
this
.
_cakeBar
.
updateUI
(
this
.
_questionIndex
,
2
);
this
.
setCandelBar
(
2
);
await
asyncDelay
(
3
);
await
asyncDelay
(
1
);
}
}
this
.
nextStep
(
isAnswer
)
this
.
nextStep
(
isAnswer
)
}
}
setCandelBar
(
state
:
number
)
{
this
.
_cakeBar
.
updateUI
(
this
.
_questionIndex
,
state
);
console
.
log
(
"
setCandelBar
"
);
if
(
state
==
2
)
{
this
.
_wrongQuestion
++
;
}
}
async
nextStep
(
isAnswer
)
{
async
nextStep
(
isAnswer
)
{
...
@@ -344,7 +377,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -344,7 +377,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
console
.
log
(
"
start evolution
"
);
console
.
log
(
"
start evolution
"
);
asyncTweenTo
(
this
.
candleRoot
,
0.5
,
{
x
:
-
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
candleRoot
,
0.5
,
{
x
:
-
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
choseARoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
choseARoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
choseBRoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
choseBRoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
...
@@ -364,11 +396,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -364,11 +396,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
candleRoot
.
active
=
true
;
this
.
candleRoot
.
active
=
true
;
this
.
_candle
.
setSkin
(
1
);
this
.
_candle
.
setSkin
(
1
);
await
asyncTweenTo
(
this
.
candleRoot
,
0.5
,
{
x
:
-
550
})
this
.
answerNode
.
node
.
active
=
true
;
asyncTweenTo
(
this
.
candleRoot
,
0.5
,
{
x
:
-
550
});
await
asyncTweenTo
(
this
.
answerNode
.
node
,
0.5
,
{
x
:
500
});
this
.
_startCourseware
();
this
.
_startCourseware
();
}
else
{
}
else
{
this
.
cakePiece
.
active
=
false
;
asyncTweenTo
(
this
.
candleRoot
,
0.5
,
{
x
:
-
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
choseARoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
choseBRoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
asyncTweenTo
(
this
.
audioRoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
await
asyncTweenTo
(
this
.
cakeRoot
,
0.5
,
{
x
:
cc
.
winSize
.
width
})
this
.
_toNextQueston
();
this
.
_toNextQueston
();
}
}
...
@@ -398,19 +440,29 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -398,19 +440,29 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
_coursewareStoped
();
this
.
_coursewareStoped
();
}
}
_answerNow
()
{
this
.
_coursewareStoped
();
}
async
_coursewareStoped
()
{
async
_coursewareStoped
()
{
if
(
this
.
_coursewareDone
)
return
;
if
(
this
.
_coursewareDone
)
return
;
this
.
_coursewareDone
=
true
;
this
.
_coursewareDone
=
true
;
this
.
_candle
.
fireStop
();
asyncTweenTo
(
this
.
candleRoot
,
0.5
,
{
x
:
-
cc
.
winSize
.
width
});
asyncTweenTo
(
this
.
answerNode
.
node
,
0.5
,
{
x
:
cc
.
winSize
.
width
});
this
.
cover
.
active
=
true
;
this
.
cover
.
active
=
true
;
cc
.
tween
(
this
.
cover
).
to
(
0.5
,
{
opacity
:
255
}).
start
();
cc
.
tween
(
this
.
cover
).
to
(
0.5
,
{
opacity
:
255
}).
start
();
await
asyncDelay
(
0.5
);
await
asyncDelay
(
0.5
);
if
(
window
[
"
courseware
"
]?.
stopTest
)
{
if
(
window
[
"
courseware
"
]?.
stopTest
)
{
window
[
"
courseware
"
]?.
stopTest
(
this
.
_coursewareEnd
.
bind
(
this
));
window
[
"
courseware
"
]?.
stopTest
((
res
)
=>
{
this
.
_coursewareEnd
(
res
.
result
?.
pronunciation
||
0
)
});
}
else
{
}
else
{
await
asyncDelay
(
3
);
await
asyncDelay
(
3
);
console
.
log
(
"
web 模拟录音评测 结果
"
);
console
.
log
(
"
web 模拟录音评测 结果
"
);
this
.
_coursewareEnd
(
Math
.
random
()
>
0.5
?
100
:
70
)
this
.
_coursewareEnd
(
Math
.
random
()
>
0.5
?
100
:
70
)
...
@@ -420,6 +472,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -420,6 +472,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
async
_coursewareEnd
(
score
:
number
)
{
async
_coursewareEnd
(
score
:
number
)
{
if
(
score
>=
80
)
{
if
(
score
>=
80
)
{
console
.
log
(
"
good
"
);
console
.
log
(
"
good
"
);
this
.
excellent
.
node
.
active
=
true
;
this
.
excellent
.
node
.
active
=
true
;
this
.
excellent
.
playAnimation
(
"
newAnimation
"
,
1
);
this
.
excellent
.
playAnimation
(
"
newAnimation
"
,
1
);
...
@@ -428,6 +482,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -428,6 +482,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
excellent
.
node
.
active
=
false
;
this
.
excellent
.
node
.
active
=
false
;
cc
.
tween
(
this
.
cover
).
to
(
0.5
,
{
opacity
:
0
}).
start
();
cc
.
tween
(
this
.
cover
).
to
(
0.5
,
{
opacity
:
0
}).
start
();
this
.
setCandelBar
(
1
)
await
asyncDelay
(
0.5
);
await
asyncDelay
(
0.5
);
this
.
cover
.
active
=
false
;
this
.
cover
.
active
=
false
;
...
@@ -438,6 +493,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -438,6 +493,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
{
}
else
{
this
.
setCandelBar
(
2
)
this
.
nictTry
.
y
=
cc
.
winSize
.
height
;
this
.
nictTry
.
y
=
cc
.
winSize
.
height
;
this
.
nictTry
.
active
=
true
;
this
.
nictTry
.
active
=
true
;
cc
.
tween
(
this
.
nictTry
).
cc
.
tween
(
this
.
nictTry
).
...
@@ -483,8 +539,58 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -483,8 +539,58 @@ export default class SceneComponent extends MyCocosSceneComponent {
endQuestion
()
{
async
endQuestion
()
{
console
.
log
(
"
endQuestion
"
);
console
.
log
(
"
endQuestion this._wrongQuestion =
"
+
this
.
_wrongQuestion
);
this
.
cover
.
active
=
true
;
this
.
cover
.
opacity
=
0
;
cc
.
tween
(
this
.
cover
).
to
(
0.5
,
{
opacity
:
255
}).
start
();
this
.
endRoot
.
active
=
true
;
if
(
this
.
_wrongQuestion
==
0
)
{
this
.
endRoot
.
active
=
true
;
this
.
endRoot
.
getChildByName
(
"
flower
"
).
active
=
true
;
this
.
playLocalAudio
(
"
effect_all_right
"
);
await
asyncDelay
(
3
);
onHomeworkFinish
();
}
else
{
if
(
this
.
_wrongQuestion
/
this
.
_totalQuestion
<=
0.2
)
{
let
node
=
this
.
endRoot
.
getChildByName
(
"
nicetry
"
)
node
.
y
=
cc
.
winSize
.
height
;
node
.
active
=
true
;
cc
.
tween
(
node
).
to
(
0.5
,
{
y
:
-
cc
.
winSize
.
height
/
10
},
{
easing
:
"
bounceIn
"
}).
call
(()
=>
{
this
.
playLocalAudio
(
"
effect_nicetry
"
)
}).
to
(
0.3
,
{
y
:
0
},
{
easing
:
"
bounceOut
"
}).
delay
(
1
).
to
(
0.5
,
{
y
:
-
cc
.
winSize
.
height
}).
call
(
async
()
=>
{
onHomeworkFinish
();
}).
start
();
}
else
{
let
node
=
this
.
endRoot
.
getChildByName
(
"
comeon
"
)
node
.
y
=
cc
.
winSize
.
height
;
node
.
active
=
true
;
cc
.
tween
(
node
).
to
(
0.5
,
{
y
:
-
cc
.
winSize
.
height
/
10
},
{
easing
:
"
bounceIn
"
}).
call
(()
=>
{
this
.
playLocalAudio
(
"
effect_final_report
"
)
}).
to
(
0.3
,
{
y
:
0
},
{
easing
:
"
bounceOut
"
}).
delay
(
1
).
to
(
0.5
,
{
y
:
-
cc
.
winSize
.
height
}).
call
(
async
()
=>
{
onHomeworkFinish
();
}).
start
();
}
}
}
}
initListener
()
{
initListener
()
{
...
...
assets/cake_template_test/script/defaultData.ts
View file @
afc17203
...
@@ -42,6 +42,49 @@ export const defaultData = {
...
@@ -42,6 +42,49 @@ export const defaultData = {
"
testWaitTime
"
:
3
,
"
testWaitTime
"
:
3
,
"
rightLetter
"
:
"
a
"
,
"
rightLetter
"
:
"
a
"
,
"
wrongLetter
"
:
"
e
"
"
wrongLetter
"
:
"
e
"
},
{
"
text
"
:
"
apple
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/7c18e0838dcf0707f885842ed09e1579.mp3
"
,
"
dragonBoneData
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
"
http://staging-teach.cdn.ireadabc.com/703a41d6c7afe6fe653014d585ef0d58.json
"
,
"
name
"
:
"
d1_ske.json
"
},
"
texJsonData
"
:
{
"
url
"
:
"
http://staging-teach.cdn.ireadabc.com/02bbebdc4a9f4a35d9ec285f61fca19c.json
"
,
"
name
"
:
"
d1_tex.json
"
},
"
texPngData
"
:
{
"
url
"
:
"
http://staging-teach.cdn.ireadabc.com/ba2041fb4f69c37be52b76f5fb274c09.png
"
,
"
name
"
:
"
d1_tex.png
"
}
},
"
choosewaitTime
"
:
5
,
"
testWaitTime
"
:
3
,
"
rightLetter
"
:
"
a
"
,
"
wrongLetter
"
:
"
e
"
},
{
"
text
"
:
"
apple
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/7c18e0838dcf0707f885842ed09e1579.mp3
"
,
"
dragonBoneData
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
"
http://staging-teach.cdn.ireadabc.com/703a41d6c7afe6fe653014d585ef0d58.json
"
,
"
name
"
:
"
d1_ske.json
"
},
"
texJsonData
"
:
{
"
url
"
:
"
http://staging-teach.cdn.ireadabc.com/02bbebdc4a9f4a35d9ec285f61fca19c.json
"
,
"
name
"
:
"
d1_tex.json
"
},
"
texPngData
"
:
{
"
url
"
:
"
http://staging-teach.cdn.ireadabc.com/ba2041fb4f69c37be52b76f5fb274c09.png
"
,
"
name
"
:
"
d1_tex.png
"
}
},
"
choosewaitTime
"
:
5
,
"
testWaitTime
"
:
3
,
"
rightLetter
"
:
"
a
"
,
"
wrongLetter
"
:
"
e
"
}],
}],
"
title
"
:
"
whats you name
"
,
"
title
"
:
"
whats you name
"
,
"
guideAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/40468ef6d120d03f83541b9344c6f9ea.mp3
"
"
guideAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/40468ef6d120d03f83541b9344c6f9ea.mp3
"
...
...
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