Commit c31c6268 authored by 李帅's avatar 李帅

优化

parent 85d52699
...@@ -78,52 +78,49 @@ ...@@ -78,52 +78,49 @@
"__id__": 7 "__id__": 7
}, },
{ {
"__id__": 8 "__id__": 9
},
{
"__id__": 10
}, },
{ {
"__id__": 12 "__id__": 11
}, },
{ {
"__id__": 15 "__id__": 14
}, },
{ {
"__id__": 18 "__id__": 17
}, },
{ {
"__id__": 20 "__id__": 19
}, },
{ {
"__id__": 67 "__id__": 66
}, },
{ {
"__id__": 72 "__id__": 71
}, },
{ {
"__id__": 75 "__id__": 74
}, },
{ {
"__id__": 78 "__id__": 77
}, },
{ {
"__id__": 83 "__id__": 82
}, },
{ {
"__id__": 102 "__id__": 101
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 106 "__id__": 105
}, },
{ {
"__id__": 107 "__id__": 106
}, },
{ {
"__id__": 108 "__id__": 107
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -366,64 +363,6 @@ ...@@ -366,64 +363,6 @@
"_atlas": null, "_atlas": null,
"_id": "97/S6HDq9MeqgmV1Zwnhbb" "_id": "97/S6HDq9MeqgmV1Zwnhbb"
}, },
{
"__type__": "cc.Node",
"_name": "left",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "90Awzg/8BAjK5yf5MoCkz/"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bg_img", "_name": "bg_img",
...@@ -435,7 +374,7 @@ ...@@ -435,7 +374,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 8
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -491,7 +430,7 @@ ...@@ -491,7 +430,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 7
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -527,7 +466,7 @@ ...@@ -527,7 +466,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 11 "__id__": 10
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -583,7 +522,7 @@ ...@@ -583,7 +522,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 10 "__id__": 9
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -621,10 +560,10 @@ ...@@ -621,10 +560,10 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 13 "__id__": 12
}, },
{ {
"__id__": 14 "__id__": 13
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -680,7 +619,7 @@ ...@@ -680,7 +619,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 12 "__id__": 11
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -712,7 +651,7 @@ ...@@ -712,7 +651,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 12 "__id__": 11
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -786,10 +725,10 @@ ...@@ -786,10 +725,10 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 16 "__id__": 15
}, },
{ {
"__id__": 17 "__id__": 16
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -845,7 +784,7 @@ ...@@ -845,7 +784,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 15 "__id__": 14
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -877,7 +816,7 @@ ...@@ -877,7 +816,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 15 "__id__": 14
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -951,7 +890,7 @@ ...@@ -951,7 +890,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 18
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1007,7 +946,7 @@ ...@@ -1007,7 +946,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 18 "__id__": 17
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1043,13 +982,13 @@ ...@@ -1043,13 +982,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 21 "__id__": 20
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 66 "__id__": 65
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1105,23 +1044,23 @@ ...@@ -1105,23 +1044,23 @@
"_name": "view", "_name": "view",
"_objFlags": 512, "_objFlags": 512,
"_parent": { "_parent": {
"__id__": 20 "__id__": 19
}, },
"_children": [ "_children": [
{ {
"__id__": 22 "__id__": 21
}, },
{ {
"__id__": 25 "__id__": 24
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 64 "__id__": 63
}, },
{ {
"__id__": 65 "__id__": 64
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1177,16 +1116,16 @@ ...@@ -1177,16 +1116,16 @@
"_name": "content", "_name": "content",
"_objFlags": 512, "_objFlags": 512,
"_parent": { "_parent": {
"__id__": 21 "__id__": 20
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 23 "__id__": 22
}, },
{ {
"__id__": 24 "__id__": 23
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1242,7 +1181,7 @@ ...@@ -1242,7 +1181,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 21
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1269,7 +1208,7 @@ ...@@ -1269,7 +1208,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 21
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
...@@ -1301,38 +1240,38 @@ ...@@ -1301,38 +1240,38 @@
"_name": "item", "_name": "item",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 21 "__id__": 20
}, },
"_children": [ "_children": [
{ {
"__id__": 26 "__id__": 25
}, },
{ {
"__id__": 29 "__id__": 28
}, },
{ {
"__id__": 33 "__id__": 32
}, },
{ {
"__id__": 37 "__id__": 36
}, },
{ {
"__id__": 40 "__id__": 39
}, },
{ {
"__id__": 50 "__id__": 49
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 61 "__id__": 60
}, },
{ {
"__id__": 62 "__id__": 61
}, },
{ {
"__id__": 63 "__id__": 62
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1388,16 +1327,16 @@ ...@@ -1388,16 +1327,16 @@
"_name": "icon_tip", "_name": "icon_tip",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 25 "__id__": 24
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 26
}, },
{ {
"__id__": 28 "__id__": 27
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1453,7 +1392,7 @@ ...@@ -1453,7 +1392,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 26 "__id__": 25
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1485,7 +1424,7 @@ ...@@ -1485,7 +1424,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 26 "__id__": 25
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1512,19 +1451,19 @@ ...@@ -1512,19 +1451,19 @@
"_name": "label", "_name": "label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 25 "__id__": 24
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 30 "__id__": 29
}, },
{ {
"__id__": 31 "__id__": 30
}, },
{ {
"__id__": 32 "__id__": 31
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1580,7 +1519,7 @@ ...@@ -1580,7 +1519,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 29 "__id__": 28
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1615,7 +1554,7 @@ ...@@ -1615,7 +1554,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 29 "__id__": 28
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1642,7 +1581,7 @@ ...@@ -1642,7 +1581,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 29 "__id__": 28
}, },
"_enabled": true, "_enabled": true,
"label": null, "label": null,
...@@ -1653,19 +1592,19 @@ ...@@ -1653,19 +1592,19 @@
"_name": "btn_record", "_name": "btn_record",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 25 "__id__": 24
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 34 "__id__": 33
}, },
{ {
"__id__": 35 "__id__": 34
}, },
{ {
"__id__": 36 "__id__": 35
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1721,7 +1660,7 @@ ...@@ -1721,7 +1660,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 33 "__id__": 32
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1753,7 +1692,7 @@ ...@@ -1753,7 +1692,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 33 "__id__": 32
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1780,7 +1719,7 @@ ...@@ -1780,7 +1719,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 33 "__id__": 32
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -1848,16 +1787,16 @@ ...@@ -1848,16 +1787,16 @@
"_name": "btn_record_click", "_name": "btn_record_click",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 25 "__id__": 24
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 38 "__id__": 37
}, },
{ {
"__id__": 39 "__id__": 38
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1913,7 +1852,7 @@ ...@@ -1913,7 +1852,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 37 "__id__": 36
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -1945,7 +1884,7 @@ ...@@ -1945,7 +1884,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 37 "__id__": 36
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -1972,29 +1911,29 @@ ...@@ -1972,29 +1911,29 @@
"_name": "btn_myrecord", "_name": "btn_myrecord",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 25 "__id__": 24
}, },
"_children": [ "_children": [
{ {
"__id__": 41 "__id__": 40
}, },
{ {
"__id__": 43 "__id__": 42
}, },
{ {
"__id__": 45 "__id__": 44
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 47 "__id__": 46
}, },
{ {
"__id__": 48 "__id__": 47
}, },
{ {
"__id__": 49 "__id__": 48
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2050,13 +1989,13 @@ ...@@ -2050,13 +1989,13 @@
"_name": "icon_myrecord1", "_name": "icon_myrecord1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 40 "__id__": 39
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 42 "__id__": 41
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2112,7 +2051,7 @@ ...@@ -2112,7 +2051,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 41 "__id__": 40
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2144,13 +2083,13 @@ ...@@ -2144,13 +2083,13 @@
"_name": "icon_myrecord2", "_name": "icon_myrecord2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 40 "__id__": 39
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 44 "__id__": 43
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2206,7 +2145,7 @@ ...@@ -2206,7 +2145,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 43 "__id__": 42
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2238,13 +2177,13 @@ ...@@ -2238,13 +2177,13 @@
"_name": "icon_myrecord3", "_name": "icon_myrecord3",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 40 "__id__": 39
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 46 "__id__": 45
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2300,7 +2239,7 @@ ...@@ -2300,7 +2239,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 45 "__id__": 44
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2332,7 +2271,7 @@ ...@@ -2332,7 +2271,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 40 "__id__": 39
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2364,7 +2303,7 @@ ...@@ -2364,7 +2303,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 40 "__id__": 39
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -2391,7 +2330,7 @@ ...@@ -2391,7 +2330,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 40 "__id__": 39
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -2459,21 +2398,24 @@ ...@@ -2459,21 +2398,24 @@
"_name": "btn_myrecord_play", "_name": "btn_myrecord_play",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 25 "__id__": 24
}, },
"_children": [ "_children": [
{ {
"__id__": 51 "__id__": 50
}, },
{ {
"__id__": 53 "__id__": 52
}, },
{ {
"__id__": 55 "__id__": 54
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{
"__id__": 56
},
{ {
"__id__": 57 "__id__": 57
}, },
...@@ -2482,9 +2424,6 @@ ...@@ -2482,9 +2424,6 @@
}, },
{ {
"__id__": 59 "__id__": 59
},
{
"__id__": 60
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2540,13 +2479,13 @@ ...@@ -2540,13 +2479,13 @@
"_name": "icon_myrecord1", "_name": "icon_myrecord1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 50 "__id__": 49
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 52 "__id__": 51
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2602,7 +2541,7 @@ ...@@ -2602,7 +2541,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 51 "__id__": 50
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2634,13 +2573,13 @@ ...@@ -2634,13 +2573,13 @@
"_name": "icon_myrecord2", "_name": "icon_myrecord2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 50 "__id__": 49
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 54 "__id__": 53
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2696,7 +2635,7 @@ ...@@ -2696,7 +2635,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 53 "__id__": 52
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2728,13 +2667,13 @@ ...@@ -2728,13 +2667,13 @@
"_name": "icon_myrecord3", "_name": "icon_myrecord3",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 50 "__id__": 49
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 56 "__id__": 55
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2790,7 +2729,7 @@ ...@@ -2790,7 +2729,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 55 "__id__": 54
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2822,7 +2761,7 @@ ...@@ -2822,7 +2761,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 50 "__id__": 49
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -2854,7 +2793,7 @@ ...@@ -2854,7 +2793,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 50 "__id__": 49
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": { "_defaultClip": {
...@@ -2873,7 +2812,7 @@ ...@@ -2873,7 +2812,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 50 "__id__": 49
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -2900,7 +2839,7 @@ ...@@ -2900,7 +2839,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 50 "__id__": 49
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -2968,7 +2907,7 @@ ...@@ -2968,7 +2907,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 25 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -2995,26 +2934,26 @@ ...@@ -2995,26 +2934,26 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 25 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"label": { "label": {
"__id__": 32 "__id__": 31
}, },
"tip": { "tip": {
"__id__": 26 "__id__": 25
}, },
"record": { "record": {
"__id__": 33 "__id__": 32
}, },
"record_click": { "record_click": {
"__id__": 37 "__id__": 36
}, },
"myrecord": { "myrecord": {
"__id__": 40 "__id__": 39
}, },
"myrecord_play": { "myrecord_play": {
"__id__": 50 "__id__": 49
}, },
"_id": "78sbViiXNOl5SgddmNDgr+" "_id": "78sbViiXNOl5SgddmNDgr+"
}, },
...@@ -3023,7 +2962,7 @@ ...@@ -3023,7 +2962,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 25 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -3091,7 +3030,7 @@ ...@@ -3091,7 +3030,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 21 "__id__": 20
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3111,7 +3050,7 @@ ...@@ -3111,7 +3050,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 21 "__id__": 20
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -3138,7 +3077,7 @@ ...@@ -3138,7 +3077,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 20 "__id__": 19
}, },
"_enabled": true, "_enabled": true,
"horizontal": false, "horizontal": false,
...@@ -3150,10 +3089,10 @@ ...@@ -3150,10 +3089,10 @@
"scrollEvents": [], "scrollEvents": [],
"cancelInnerEvents": true, "cancelInnerEvents": true,
"_N$content": { "_N$content": {
"__id__": 22 "__id__": 21
}, },
"content": { "content": {
"__id__": 22 "__id__": 21
}, },
"_N$horizontalScrollBar": null, "_N$horizontalScrollBar": null,
"_N$verticalScrollBar": null, "_N$verticalScrollBar": null,
...@@ -3168,16 +3107,16 @@ ...@@ -3168,16 +3107,16 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 68 "__id__": 67
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 70 "__id__": 69
}, },
{ {
"__id__": 71 "__id__": 70
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3230,16 +3169,16 @@ ...@@ -3230,16 +3169,16 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "录音", "_name": "icon_record",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 67 "__id__": 66
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 69 "__id__": 68
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3295,7 +3234,7 @@ ...@@ -3295,7 +3234,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 68 "__id__": 67
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3327,7 +3266,7 @@ ...@@ -3327,7 +3266,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 67 "__id__": 66
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -3354,7 +3293,7 @@ ...@@ -3354,7 +3293,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 67 "__id__": 66
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -3428,10 +3367,10 @@ ...@@ -3428,10 +3367,10 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 73 "__id__": 72
}, },
{ {
"__id__": 74 "__id__": 73
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3487,7 +3426,7 @@ ...@@ -3487,7 +3426,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 72 "__id__": 71
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3519,7 +3458,7 @@ ...@@ -3519,7 +3458,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 72 "__id__": 71
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -3593,10 +3532,10 @@ ...@@ -3593,10 +3532,10 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 76 "__id__": 75
}, },
{ {
"__id__": 77 "__id__": 76
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3652,7 +3591,7 @@ ...@@ -3652,7 +3591,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 75 "__id__": 74
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3684,7 +3623,7 @@ ...@@ -3684,7 +3623,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 75 "__id__": 74
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -3756,16 +3695,16 @@ ...@@ -3756,16 +3695,16 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 79 "__id__": 78
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 81 "__id__": 80
}, },
{ {
"__id__": 82 "__id__": 81
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3821,13 +3760,13 @@ ...@@ -3821,13 +3760,13 @@
"_name": "label", "_name": "label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 78 "__id__": 77
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 80 "__id__": 79
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3883,7 +3822,7 @@ ...@@ -3883,7 +3822,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 79 "__id__": 78
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3916,7 +3855,7 @@ ...@@ -3916,7 +3855,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 78 "__id__": 77
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -3948,7 +3887,7 @@ ...@@ -3948,7 +3887,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 78 "__id__": 77
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -3979,25 +3918,25 @@ ...@@ -3979,25 +3918,25 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 84 "__id__": 83
}, },
{ {
"__id__": 88 "__id__": 87
}, },
{ {
"__id__": 91 "__id__": 90
}, },
{ {
"__id__": 93 "__id__": 92
}, },
{ {
"__id__": 97 "__id__": 96
} }
], ],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 101 "__id__": 100
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4053,19 +3992,19 @@ ...@@ -4053,19 +3992,19 @@
"_name": "mask", "_name": "mask",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 83 "__id__": 82
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 85 "__id__": 84
}, },
{ {
"__id__": 86 "__id__": 85
}, },
{ {
"__id__": 87 "__id__": 86
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4121,7 +4060,7 @@ ...@@ -4121,7 +4060,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 84 "__id__": 83
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4153,7 +4092,7 @@ ...@@ -4153,7 +4092,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 84 "__id__": 83
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -4180,7 +4119,7 @@ ...@@ -4180,7 +4119,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 84 "__id__": 83
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -4248,16 +4187,16 @@ ...@@ -4248,16 +4187,16 @@
"_name": "bg", "_name": "bg",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 83 "__id__": 82
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 89 "__id__": 88
}, },
{ {
"__id__": 90 "__id__": 89
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4313,7 +4252,7 @@ ...@@ -4313,7 +4252,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 88 "__id__": 87
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4345,7 +4284,7 @@ ...@@ -4345,7 +4284,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 88 "__id__": 87
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -4406,7 +4345,7 @@ ...@@ -4406,7 +4345,7 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 88 "__id__": 87
}, },
"_id": "dbf6SlfeFJtqujsCK52/CR" "_id": "dbf6SlfeFJtqujsCK52/CR"
}, },
...@@ -4415,13 +4354,13 @@ ...@@ -4415,13 +4354,13 @@
"_name": "label", "_name": "label",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 83 "__id__": 82
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 92 "__id__": 91
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4477,7 +4416,7 @@ ...@@ -4477,7 +4416,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 91 "__id__": 90
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4512,16 +4451,16 @@ ...@@ -4512,16 +4451,16 @@
"_name": "start", "_name": "start",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 83 "__id__": 82
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 94 "__id__": 93
}, },
{ {
"__id__": 95 "__id__": 94
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4577,7 +4516,7 @@ ...@@ -4577,7 +4516,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 93 "__id__": 92
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4609,7 +4548,7 @@ ...@@ -4609,7 +4548,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 93 "__id__": 92
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -4618,7 +4557,7 @@ ...@@ -4618,7 +4557,7 @@
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 96 "__id__": 95
} }
], ],
"_N$interactable": true, "_N$interactable": true,
...@@ -4674,7 +4613,7 @@ ...@@ -4674,7 +4613,7 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 93 "__id__": 92
}, },
"_id": "f86X4c6OtP4K2F2ODiAK9B" "_id": "f86X4c6OtP4K2F2ODiAK9B"
}, },
...@@ -4693,16 +4632,16 @@ ...@@ -4693,16 +4632,16 @@
"_name": "restart", "_name": "restart",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 83 "__id__": 82
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 98 "__id__": 97
}, },
{ {
"__id__": 99 "__id__": 98
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -4758,7 +4697,7 @@ ...@@ -4758,7 +4697,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 97 "__id__": 96
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -4790,7 +4729,7 @@ ...@@ -4790,7 +4729,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 97 "__id__": 96
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -4799,7 +4738,7 @@ ...@@ -4799,7 +4738,7 @@
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 100 "__id__": 99
} }
], ],
"_N$interactable": true, "_N$interactable": true,
...@@ -4874,7 +4813,7 @@ ...@@ -4874,7 +4813,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 83 "__id__": 82
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 1,
...@@ -4905,7 +4844,7 @@ ...@@ -4905,7 +4844,7 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 103 "__id__": 102
} }
], ],
"_active": true, "_active": true,
...@@ -4963,11 +4902,11 @@ ...@@ -4963,11 +4902,11 @@
"_name": "audio", "_name": "audio",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 102 "__id__": 101
}, },
"_children": [ "_children": [
{ {
"__id__": 104 "__id__": 103
} }
], ],
"_active": true, "_active": true,
...@@ -5025,13 +4964,13 @@ ...@@ -5025,13 +4964,13 @@
"_name": "btn", "_name": "btn",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 103 "__id__": 102
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 105 "__id__": 104
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -5087,7 +5026,7 @@ ...@@ -5087,7 +5026,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 104 "__id__": 103
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
...@@ -5154,13 +5093,13 @@ ...@@ -5154,13 +5093,13 @@
}, },
"_enabled": true, "_enabled": true,
"item": { "item": {
"__id__": 25 "__id__": 24
}, },
"content": { "content": {
"__id__": 22 "__id__": 21
}, },
"tip": { "tip": {
"__id__": 83 "__id__": 82
}, },
"_id": "eaTVUpqahPfZeO9+sUI7RP" "_id": "eaTVUpqahPfZeO9+sUI7RP"
} }
......
/* /*
* @Author: ls * @Author: ls
* @Date: 2022-05-15 18:22:18 * @Date: 2022-05-15 18:22:18
* @LastEditTime: 2022-05-22 17:37:44 * @LastEditTime: 2022-05-22 19:21:58
* @LastEditors: ls * @LastEditors: ls
* @Description: * @Description:
* @FilePath: \ls_gramophone\assets\ls_gramophone\scene\ls_gramophone.ts * @FilePath: \ls_gramophone\assets\ls_gramophone\scene\ls_gramophone.ts
*/ */
import Item from '../script/Item'; import Item from '../script/Item';
import { MyCocosSceneComponent } from '../script/MyCocosSceneComponent'; import { MyCocosSceneComponent } from '../script/MyCocosSceneComponent';
import { onHomeworkFinish } from '../script/util';
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -179,7 +180,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -179,7 +180,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
record_stop.active = true; record_stop.active = true;
this._recording = true; this._recording = true;
// window['Recorder'].start();
if (window['courseware']) {
window['courseware'].startRecord(1);
}
}); });
record_stop.on('click', () => { record_stop.on('click', () => {
this.playLocalAudio('btn'); this.playLocalAudio('btn');
...@@ -189,20 +193,43 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -189,20 +193,43 @@ export default class SceneComponent extends MyCocosSceneComponent {
record_stop.active = false; record_stop.active = false;
this._recording = false; this._recording = false;
// window['Recorder'].stop();
let idx = -1; // 获取当前录制下标
for (let index = 0; index < this.content.childrenCount; index++) { for (let index = 0; index < this.content.childrenCount; index++) {
const element = this.content.children[index]; const element = this.content.children[index];
// 正在录制中 // 正在录制中
if (element.getComponent(Item).getRecording()) { if (element.getComponent(Item).getRecording()) {
element.getComponent(Item).recorded(); idx = index;
break;
}
}
if (window['courseware']) {
window['courseware'].stopRecord((res) => {
this.log('--------录音返回结果 stopRecord ------------');
this.log(res);
this.log(`录音的音频URL是${JSON.parse(res).audioUrl}`);
if (idx !== -1) {
this.content.children[idx].getComponent(Item).recorded();
}
this._records[index] = '';
// this._records[index] = window['Recorder'].getBlob();
this.resetRecord(); this.resetRecord();
return;
if (res && JSON.parse(res).audioUrl) {
if (idx !== -1) {
this._records[idx] = JSON.parse(res).audioUrl;
onHomeworkFinish(res);
}
}
});
} else {
if (idx !== -1) {
this.content.children[idx].getComponent(Item).recorded();
} }
this.resetRecord();
} }
}); });
} }
......
export function getPosByAngle(angle, len) { export function getPosByAngle(angle, len) {
const radian = (angle * Math.PI) / 180;
const radian = angle * Math.PI / 180;
const x = Math.sin(radian) * len; const x = Math.sin(radian) * len;
const y = Math.cos(radian) * len; const y = Math.cos(radian) * len;
return { x, y }; return { x, y };
} }
export function getAngleByPos(px, py, mx, my) { export function getAngleByPos(px, py, mx, my) {
const x = Math.abs(px - mx); const x = Math.abs(px - mx);
const y = Math.abs(py - my); const y = Math.abs(py - my);
const z = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); const z = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
const cos = y / z; const cos = y / z;
const radina = Math.acos(cos); // 用反三角函数求弧度 const radina = Math.acos(cos); // 用反三角函数求弧度
let angle = Math.floor(180 / (Math.PI / radina) * 100) / 100; // 将弧度转换成角度 let angle = Math.floor((180 / (Math.PI / radina)) * 100) / 100; // 将弧度转换成角度
if (mx > px && my > py) {// 鼠标在第四象限 if (mx > px && my > py) {
// 鼠标在第四象限
angle = 180 - angle; angle = 180 - angle;
} }
if (mx === px && my > py) {// 鼠标在y轴负方向上 if (mx === px && my > py) {
// 鼠标在y轴负方向上
angle = 180; angle = 180;
} }
if (mx > px && my === py) {// 鼠标在x轴正方向上 if (mx > px && my === py) {
// 鼠标在x轴正方向上
angle = 90; angle = 90;
} }
if (mx < px && my > py) {// 鼠标在第三象限 if (mx < px && my > py) {
// 鼠标在第三象限
angle = 180 + angle; angle = 180 + angle;
} }
if (mx < px && my === py) {// 鼠标在x轴负方向 if (mx < px && my === py) {
// 鼠标在x轴负方向
angle = 270; angle = 270;
} }
if (mx < px && my < py) {// 鼠标在第二象限 if (mx < px && my < py) {
// 鼠标在第二象限
angle = 360 - angle; angle = 360 - angle;
} }
// console.log('angle: ', angle); // console.log('angle: ', angle);
return angle; return angle;
} }
export function exchangeNodePos(baseNode, targetNode) { export function exchangeNodePos(baseNode, targetNode) {
...@@ -94,13 +96,13 @@ export function getScaleRateBy2Node(baseNode, targetNode, maxFlag = true) { ...@@ -94,13 +96,13 @@ export function getScaleRateBy2Node(baseNode, targetNode, maxFlag = true) {
} }
} }
export function getDistance (start, end){ export function getDistance(start, end) {
var pos = cc.v2(start.x - end.x, start.y - end.y); var pos = cc.v2(start.x - end.x, start.y - end.y);
var dis = Math.sqrt(pos.x*pos.x + pos.y*pos.y); var dis = Math.sqrt(pos.x * pos.x + pos.y * pos.y);
return dis; return dis;
} }
export function playAudioByUrl(audio_url, cb=null) { export function playAudioByUrl(audio_url, cb = null) {
if (audio_url) { if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => { cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8); const audioId = cc.audioEngine.play(audioClip, false, 0.8);
...@@ -113,34 +115,32 @@ export function playAudioByUrl(audio_url, cb=null) { ...@@ -113,34 +115,32 @@ export function playAudioByUrl(audio_url, cb=null) {
} }
} }
export function btnClickAnima(btn, time = 0.15, rate = 1.05) {
export function btnClickAnima(btn, time=0.15, rate=1.05) {
btn.tmpScale = btn.scale; btn.tmpScale = btn.scale;
btn.on(cc.Node.EventType.TOUCH_START, () => { btn.on(cc.Node.EventType.TOUCH_START, () => {
cc.tween(btn) cc.tween(btn)
.to(time / 2, {scale: btn.scale * rate}) .to(time / 2, { scale: btn.scale * rate })
.start() .start();
}) });
btn.on(cc.Node.EventType.TOUCH_CANCEL, () => { btn.on(cc.Node.EventType.TOUCH_CANCEL, () => {
cc.tween(btn) cc.tween(btn)
.to(time / 2, {scale: btn.tmpScale}) .to(time / 2, { scale: btn.tmpScale })
.start() .start();
}) });
btn.on(cc.Node.EventType.TOUCH_END, () => { btn.on(cc.Node.EventType.TOUCH_END, () => {
cc.tween(btn) cc.tween(btn)
.to(time / 2, {scale: btn.tmpScale}) .to(time / 2, { scale: btn.tmpScale })
.start() .start();
}) });
} }
export function getSpriteFrimeByUrl(url, cb) { export function getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => { cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img) const spriteFrame = new cc.SpriteFrame(img);
if (cb) { if (cb) {
cb(spriteFrame); cb(spriteFrame);
} }
}) });
} }
export function getSprNode(resName) { export function getSprNode(resName) {
...@@ -158,11 +158,9 @@ export function getSprNodeByUrl(url, cb) { ...@@ -158,11 +158,9 @@ export function getSprNodeByUrl(url, cb) {
if (cb) { if (cb) {
cb(spr); cb(spr);
} }
}) });
} }
export function playAudio(audioClip, cb = null) { export function playAudio(audioClip, cb = null) {
if (audioClip) { if (audioClip) {
const audioId = cc.audioEngine.playEffect(audioClip, false); const audioId = cc.audioEngine.playEffect(audioClip, false);
...@@ -179,20 +177,18 @@ export async function asyncDelay(time) { ...@@ -179,20 +177,18 @@ export async function asyncDelay(time) {
try { try {
cc.tween(cc.find('Canvas')) cc.tween(cc.find('Canvas'))
.delay(time) .delay(time)
.call(()=>{ .call(() => {
resolve(null); resolve(null);
}) })
.start(); .start();
} catch (e) { } catch (e) {
reject(e); reject(e);
} }
}) });
} }
export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJsonDataUrl }, texJsonData: { url: texJsonDataUrl }, texPngData: { url: texPngDataUrl } }) { export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJsonDataUrl }, texJsonData: { url: texJsonDataUrl }, texPngData: { url: texPngDataUrl } }) {
if (!texPngDataUrl || !texJsonDataUrl || !texPngDataUrl || texPngDataUrl == '' || texJsonDataUrl == '' || texPngDataUrl == '') {
if (!texPngDataUrl || !texJsonDataUrl || !texPngDataUrl
|| texPngDataUrl == '' || texJsonDataUrl == '' || texPngDataUrl == '') {
return; return;
} }
...@@ -246,7 +242,7 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs ...@@ -246,7 +242,7 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs
dragonDisplay.dragonAtlasAsset = atlas; dragonDisplay.dragonAtlasAsset = atlas;
dragonDisplay.dragonAsset = asset; dragonDisplay.dragonAsset = asset;
let armatureNames = dragonBonesJson.armature.map(data => data.name); let armatureNames = dragonBonesJson.armature.map((data) => data.name);
if (armatureNames.length > 0) { if (armatureNames.length > 0) {
dragonDisplay.armatureName = armatureNames[0]; dragonDisplay.armatureName = armatureNames[0];
...@@ -264,13 +260,7 @@ export class FireworkSettings { ...@@ -264,13 +260,7 @@ export class FireworkSettings {
range; // 扩散范围 range; // 扩散范围
number; // 发射数量 number; // 发射数量
scalseRange; // 缩放范围 scalseRange; // 缩放范围
constructor(baseNode, nodeList, constructor(baseNode, nodeList, pos = cc.v2(0, 0), side = cc.v2(0, 100), range = 50, number = 100, scalseRange = 0) {
pos = cc.v2(0, 0),
side = cc.v2(0, 100),
range = 50,
number = 100,
scalseRange = 0
) {
this.baseNode = baseNode; this.baseNode = baseNode;
this.nodeList = nodeList; this.nodeList = nodeList;
this.pos = pos; this.pos = pos;
...@@ -281,21 +271,13 @@ export class FireworkSettings { ...@@ -281,21 +271,13 @@ export class FireworkSettings {
} }
static copy(firework) { static copy(firework) {
return new FireworkSettings( return new FireworkSettings(firework.baseNode, firework.nodeList, firework.pos, firework.side, firework.range, firework.number);
firework.baseNode,
firework.nodeList,
firework.pos,
firework.side,
firework.range,
firework.number,
);
} }
} }
export async function showFireworks(fireworkSettings) { export async function showFireworks(fireworkSettings) {
const { baseNode, nodeList, pos, side, range, number, scalseRange } = fireworkSettings; const { baseNode, nodeList, pos, side, range, number, scalseRange } = fireworkSettings;
new Array(number).fill(' ').forEach(async (_, i) => { new Array(number).fill(' ').forEach(async (_, i) => {
let rabbonNode = new cc.Node(); let rabbonNode = new cc.Node();
rabbonNode.parent = baseNode; rabbonNode.parent = baseNode;
rabbonNode.x = pos.x; rabbonNode.x = pos.x;
...@@ -313,16 +295,19 @@ export async function showFireworks(fireworkSettings) { ...@@ -313,16 +295,19 @@ export async function showFireworks(fireworkSettings) {
const rate = Math.random(); const rate = Math.random();
const angle = Math.PI * (Math.random() * 2 - 1); const angle = Math.PI * (Math.random() * 2 - 1);
await asyncTweenBy(rabbonNode, 0.3, { await asyncTweenBy(
rabbonNode,
0.3,
{
x: side.x * rate + Math.cos(angle) * range * rate, x: side.x * rate + Math.cos(angle) * range * rate,
y: side.y * rate + Math.sin(angle) * range * rate y: side.y * rate + Math.sin(angle) * range * rate,
}, { },
easing: 'quadIn' {
}); easing: 'quadIn',
},
);
cc.tween(rabbonNode) cc.tween(rabbonNode).by(8, { y: -2000 }).start();
.by(8, { y: -2000 })
.start();
cc.tween(rabbonNode) cc.tween(rabbonNode)
.to(5, { scale: (Math.random() - 0.5) * scalseRange + 1 }) .to(5, { scale: (Math.random() - 0.5) * scalseRange + 1 })
...@@ -331,13 +316,7 @@ export async function showFireworks(fireworkSettings) { ...@@ -331,13 +316,7 @@ export async function showFireworks(fireworkSettings) {
rabbonFall(rabbonNode); rabbonFall(rabbonNode);
await asyncDelay(Math.random()); await asyncDelay(Math.random());
cc.tween(node) cc.tween(node).by(0.15, { x: -10, angle: -10 }).by(0.3, { x: 20, angle: 20 }).by(0.15, { x: -10, angle: -10 }).union().repeatForever().start();
.by(0.15, { x: -10, angle: -10 })
.by(0.3, { x: 20, angle: 20 })
.by(0.15, { x: -10, angle: -10 })
.union()
.repeatForever()
.start();
cc.tween(rabbonNode) cc.tween(rabbonNode)
.delay(5) .delay(5)
...@@ -355,11 +334,10 @@ export async function showFireworks(fireworkSettings) { ...@@ -355,11 +334,10 @@ export async function showFireworks(fireworkSettings) {
async function rabbonFall(node) { async function rabbonFall(node) {
const time = 1 + Math.random(); const time = 1 + Math.random();
const offsetX = RandomInt(-200, 200) * time; const offsetX = RandomInt(-200, 200) * time;
await asyncTweenBy(node, time, { x: offsetX, angle: offsetX * 60 / 200 }); await asyncTweenBy(node, time, { x: offsetX, angle: (offsetX * 60) / 200 });
rabbonFall(node); rabbonFall(node);
} }
export async function asyncTweenTo(node, duration, obj, ease = undefined) { export async function asyncTweenTo(node, duration, obj, ease = undefined) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
...@@ -411,12 +389,24 @@ export function showTrebleFirework(baseNode, rabbonList) { ...@@ -411,12 +389,24 @@ export function showTrebleFirework(baseNode, rabbonList) {
showFireworks(right); showFireworks(right);
} }
export function onHomeworkFinish() { // export function onHomeworkFinish() {
// const middleLayer = cc.find('middleLayer');
// if (middleLayer) {
// const middleLayerComponent = middleLayer.getComponent('middleLayer');
// if (middleLayerComponent.role == 'student') {
// middleLayerComponent.onHomeworkFinish(() => { });
// }
// } else {
// console.log('onHomeworkFinish');
// }
// }
export function onHomeworkFinish(data: any = null) {
const middleLayer = cc.find('middleLayer'); const middleLayer = cc.find('middleLayer');
if (middleLayer) { if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer'); const middleLayerComponent = middleLayer.getComponent('middleLayer');
if (middleLayerComponent.role == 'student') { if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { }); middleLayerComponent.onHomeworkFinish(() => {}, data);
} }
} else { } else {
console.log('onHomeworkFinish'); console.log('onHomeworkFinish');
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 83, "height": 83,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"录音": { "icon_record": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "5b67343e-8927-4b5f-9653-3aa36a67c245", "uuid": "5b67343e-8927-4b5f-9653-3aa36a67c245",
"rawTextureUuid": "fb73c820-7ca8-4450-8bb6-79d231e5733a", "rawTextureUuid": "fb73c820-7ca8-4450-8bb6-79d231e5733a",
......
{
"ver": "1.1.2",
"uuid": "b9f5800f-8915-4e6e-a914-158e979d6a84",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "53603c71-3077-4b5d-bb59-d6e15e1d3719",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"1-点击start开始": {
"ver": "1.0.4",
"uuid": "e10bc390-de9f-45ea-9d83-7e7e4d9421a6",
"rawTextureUuid": "53603c71-3077-4b5d-bb59-d6e15e1d3719",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "836ecbc5-201b-416e-8eed-5aa0fded9c34",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"2-点击左下播放按钮开始播放整段音频内容,再次点击停止播放": {
"ver": "1.0.4",
"uuid": "c1da4ac0-1475-444e-a392-2448afc2ce66",
"rawTextureUuid": "836ecbc5-201b-416e-8eed-5aa0fded9c34",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ef0f1593-1e56-4238-93fe-dda41a31dfe6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"3-点击句子播放句子的音频,同时字体颜色变成橘色,句子开头出现播放提示效果": {
"ver": "1.0.4",
"uuid": "e83c8fc3-af7a-43bb-87b3-255ba6ce4724",
"rawTextureUuid": "ef0f1593-1e56-4238-93fe-dda41a31dfe6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "e6f3ffd3-f5dd-4a53-a71e-e92e85f3519e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"4-点击句子后面的录音按钮,弹出录音界面,点击start开始录音": {
"ver": "1.0.4",
"uuid": "23555c3e-a82e-4806-a8dd-16e5a0121412",
"rawTextureUuid": "e6f3ffd3-f5dd-4a53-a71e-e92e85f3519e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "40eca57e-ea7e-4654-8ea4-828ae552021f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1334,
"height": 750,
"platformSettings": {},
"subMetas": {
"5-录音结束当前句子后面出现我的录音,点击播放": {
"ver": "1.0.4",
"uuid": "759cf454-75da-48f2-8032-143bec729c24",
"rawTextureUuid": "40eca57e-ea7e-4654-8ea4-828ae552021f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1334,
"height": 750,
"rawWidth": 1334,
"rawHeight": 750,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "78ac9a51-bbd6-40cb-be04-5ed006163563",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment