Commit ee36d426 authored by 李维's avatar 李维

dev commit

parent ddfebd10
{
"ver": "1.1.2",
"uuid": "ee1f26de-eba7-4d48-9ff4-be76e2be964f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b", "uuid": "0228048b-0aa2-4e5d-90bd-2e6296ae4419",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.130612, "duration": 1.236583,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "c1346441-63d2-4096-b5a1-0cecc042ab61",
"downloadMode": 0,
"duration": 1.854694,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "234809b3-87b1-4db0-a1bb-b4327e90de89",
"downloadMode": 0,
"duration": 1.044898,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "03402378-9ad2-4144-8d41-cf3bd78190a9",
"downloadMode": 0,
"duration": 0.84,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "712e66dd-a0ad-47ce-981b-f05fa133db57",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f9f63fef-f158-4c0f-9a35-c913ae020fc8",
"downloadMode": 0,
"duration": 5.09175,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "29f5220e-ff20-4b01-baf2-ebc27321ce7b",
"downloadMode": 0,
"duration": 1.688,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "7846aee1-a1f6-4735-9261-684e4890a253",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{"name":"apple","version":"5.5","frameRate":24,"armature":[{"name":"Armature","animation":[{"name":"apple","frame":[],"ik":[],"duration":40,"slot":[{"name":"苹果","displayFrame":[],"colorFrame":[]}],"bone":[{"name":"root","rotateFrame":[],"scaleFrame":[],"translateFrame":[]},{"name":"苹果","rotateFrame":[{"tweenEasing":0,"duration":10},{"tweenEasing":0,"rotate":3.7873,"duration":10},{"tweenEasing":0,"duration":10},{"tweenEasing":0,"rotate":-2.252,"duration":10},{"duration":0}],"scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"x":0.95,"tweenEasing":0},{"duration":10,"tweenEasing":0},{"duration":10,"x":0.95,"tweenEasing":0},{"duration":0}],"translateFrame":[]}],"playTimes":0,"ffd":[]}],"slot":[{"name":"苹果","color":{},"parent":"苹果"}],"ik":[],"skin":[{"name":"","slot":[{"name":"苹果","display":[{"name":"苹果","transform":{"x":75.9744,"skY":89.3968,"y":2.0709,"skX":89.3968},"type":"image","path":"苹果"}]}]}],"defaultActions":[{"gotoAndPlay":"apple"}],"frameRate":24,"bone":[{"name":"root","transform":{"skY":-0.08,"skX":-0.08}},{"name":"苹果","transform":{"x":-3.0546,"skY":-89.4795,"y":74.8958,"skX":-89.4795},"length":97,"parent":"root"}],"type":"Armature","aabb":{"x":-194.2950186262329,"height":397,"y":-199.55624635088836,"width":388}}],"isGlobal":0}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "cc2fde72-3c3b-4574-9741-c57a28bab1fc",
"subMetas": {}
}
\ No newline at end of file
{"name":"apple","imagePath":"apple_tex.png","height":512,"SubTexture":[{"name":"苹果","x":1,"height":397,"y":1,"width":388}],"width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "50e92afc-ad08-473d-8aba-ec7911f5fcd1",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8d0e553b-c7e0-4562-bb0a-0445fb0ad478",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 512,
"platformSettings": {},
"subMetas": {
"apple_tex": {
"ver": "1.0.4",
"uuid": "0f0588e7-76e4-4578-a752-b6bfc7b415b1",
"rawTextureUuid": "8d0e553b-c7e0-4562-bb0a-0445fb0ad478",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -61,
"offsetY": 56.5,
"trimX": 1,
"trimY": 1,
"width": 388,
"height": 397,
"rawWidth": 512,
"rawHeight": 512,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "1.1.0", "ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1", "uuid": "4278e1b0-1b0e-4c36-a439-b8e331576335",
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
"_children": [ "_children": [
{ {
"__id__": 2 "__id__": 2
},
{
"__id__": 38
} }
], ],
"_active": false, "_active": false,
...@@ -75,22 +78,28 @@ ...@@ -75,22 +78,28 @@
"__id__": 5 "__id__": 5
}, },
{ {
"__id__": 7 "__id__": 14
}, },
{ {
"__id__": 14 "__id__": 22
},
{
"__id__": 27
},
{
"__id__": 30
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 35
}, },
{ {
"__id__": 25 "__id__": 36
}, },
{ {
"__id__": 26 "__id__": 37
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -180,7 +189,7 @@ ...@@ -180,7 +189,7 @@
"array": [ "array": [
0, 0,
0, 0,
362.85545494732423, 363.73066958946424,
0, 0,
0, 0,
0, 0,
...@@ -241,20 +250,91 @@ ...@@ -241,20 +250,91 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bg", "_name": "bgMain",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
}, },
"_children": [
{
"__id__": 6
},
{
"__id__": 8
},
{
"__id__": 10
},
{
"__id__": 12
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "61Dlpng3FBto8MUZFk34Ar"
},
{
"__type__": "cc.Node",
"_name": "bg_A",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 6 "__id__": 7
} }
], ],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 0,
"_color": { "_color": {
"__type__": "cc.Color", "__type__": "cc.Color",
"r": 255, "r": 255,
...@@ -306,7 +386,7 @@ ...@@ -306,7 +386,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 5 "__id__": 6
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -317,7 +397,7 @@ ...@@ -317,7 +397,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "8288e3d4-4c75-4b27-8f01-f7014417f4dd" "__uuid__": "8fca9173-2c3b-4a8a-a2fe-3c97908a3bd9"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -335,21 +415,18 @@ ...@@ -335,21 +415,18 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "bottomPart", "_name": "bgNew_A ",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 5
},
"_children": [
{
"__id__": 8
}, },
"_children": [],
"_active": true,
"_components": [
{ {
"__id__": 11 "__id__": 9
} }
], ],
"_active": true,
"_components": [],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -361,8 +438,8 @@ ...@@ -361,8 +438,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 1280,
"height": 0 "height": 720
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -373,8 +450,8 @@ ...@@ -373,8 +450,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
635.132, 0,
-356.326, 0,
0, 0,
0, 0,
0, 0,
...@@ -396,23 +473,52 @@ ...@@ -396,23 +473,52 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "8c7k8ep/ZFNpO263+1QHz9" "_id": "578CoVS05K5IAHeBtBSz32"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "efc7ad6f-e504-4a62-b16d-aefef18faad3"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ff8mBl/i1PX71+K0oR79qe"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn_left", "_name": "bg_B",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 5
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 11
},
{
"__id__": 10
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -426,8 +532,8 @@ ...@@ -426,8 +532,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 61, "width": 1280,
"height": 67 "height": 720
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -438,8 +544,8 @@ ...@@ -438,8 +544,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-148.464, 0,
34, 0,
0, 0,
0, 0,
0, 0,
...@@ -461,14 +567,14 @@ ...@@ -461,14 +567,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "5ad2wLQLxIN5Eg7OHecSH6" "_id": "dbml4BWuRKwJrxE+5TDhHj"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 10
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -478,9 +584,7 @@ ...@@ -478,9 +584,7 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": null,
"__uuid__": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5"
},
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
"_fillType": 0, "_fillType": 0,
...@@ -493,89 +597,18 @@ ...@@ -493,89 +597,18 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "84mqOgJ3JNqZrYVTEU8CjE" "_id": "d8JNzu809IO7zeJIKpsJrM"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "bcYN/4EKBJhbIAfovo9Ah1"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn_right", "_name": "bg_C",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 5
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 12
},
{ {
"__id__": 13 "__id__": 13
} }
...@@ -591,8 +624,8 @@ ...@@ -591,8 +624,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 60, "width": 1280,
"height": 66 "height": 720
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -603,8 +636,8 @@ ...@@ -603,8 +636,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-47.164, 0,
34, 0,
0, 0,
0, 0,
0, 0,
...@@ -626,14 +659,14 @@ ...@@ -626,14 +659,14 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "46i3stdzpHX6zQHTGnRsNE" "_id": "e8YQ2CqipP76AODeH4UgjR"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 12
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -643,9 +676,7 @@ ...@@ -643,9 +676,7 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": null,
"__uuid__": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59"
},
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
"_fillType": 0, "_fillType": 0,
...@@ -658,75 +689,7 @@ ...@@ -658,75 +689,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "42Sh8QS/BHn4WiGyPQPKPt" "_id": "8foEcpDZVG77HjmvSp9pFD"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "1aj32fYY1IxLesa77E70Qu"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -860,7 +823,7 @@ ...@@ -860,7 +823,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "BRLNSDB", "_name": "Comic Sans MS",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 15 "__id__": 15
...@@ -918,7 +881,7 @@ ...@@ -918,7 +881,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "cfMLGsq0BMhJARv+ySMAxS" "_id": "14gBFjSd5AgIeRMwZXPOfe"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
...@@ -938,7 +901,7 @@ ...@@ -938,7 +901,7 @@
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": true, "_enableWrapText": true,
"_N$file": { "_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1" "__uuid__": "4278e1b0-1b0e-4c36-a439-b8e331576335"
}, },
"_isSystemFontUsed": false, "_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
...@@ -950,7 +913,7 @@ ...@@ -950,7 +913,7 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "9bNHNPu5lC7rQYyr8ai/sY" "_id": "d8F48Jm3BLF7sjDfekyb3R"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -1016,7 +979,7 @@ ...@@ -1016,7 +979,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "icon", "_name": "black",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 18 "__id__": 18
...@@ -1039,8 +1002,8 @@ ...@@ -1039,8 +1002,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 138, "width": 100,
"height": 141 "height": 100
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1074,7 +1037,7 @@ ...@@ -1074,7 +1037,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "1blU2OArJIfoC9XfupGxJG" "_id": "dbn85feHFExo1q+nsQtN4n"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
...@@ -1088,7 +1051,7 @@ ...@@ -1088,7 +1051,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a" "__uuid__": "7a2d99d6-2009-4341-83f8-f18980e6405d"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -1102,7 +1065,7 @@ ...@@ -1102,7 +1065,7 @@
"_fillRange": 0, "_fillRange": 0,
"_isTrimmedMode": true, "_isTrimmedMode": true,
"_atlas": null, "_atlas": null,
"_id": "03GEWUEZJGyKormWgIWCtM" "_id": "86147ZoQBOpKg5wejgeXRf"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
...@@ -1111,11 +1074,7 @@ ...@@ -1111,11 +1074,7 @@
"_parent": { "_parent": {
"__id__": 14 "__id__": 14
}, },
"_children": [ "_children": [],
{
"__id__": 22
}
],
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": null, "_prefab": null,
...@@ -1168,18 +1127,21 @@ ...@@ -1168,18 +1127,21 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "btn", "_name": "video_container",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 21 "__id__": 2
}, },
"_children": [], "_children": [
"_active": true,
"_components": [
{ {
"__id__": 23 "__id__": 23
},
{
"__id__": 25
} }
], ],
"_active": true,
"_components": [],
"_prefab": null, "_prefab": null,
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -1191,8 +1153,8 @@ ...@@ -1191,8 +1153,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 668,
"height": 0 "height": 353
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1203,8 +1165,8 @@ ...@@ -1203,8 +1165,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, -267.5,
0, 125,
0, 0,
0, 0,
0, 0,
...@@ -1226,25 +1188,602 @@ ...@@ -1226,25 +1188,602 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "3d0p0/uJZJIoRva5Br2iqv" "_id": "07WrlyPWpI1Ik9Q7DJEFRo"
}, },
{ {
"__type__": "cc.AudioSource", "__type__": "cc.Node",
"_name": "video",
"_objFlags": 0,
"_parent": {
"__id__": 22
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 24
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 534,
"height": 278
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
30,
-2,
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": "5dDGb4m3VNWLXVzyWPW5HX"
},
{
"__type__": "cc.VideoPlayer",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
},
"_enabled": true,
"_resourceType": 1,
"_remoteURL": "https://fd.aigei.com/pvvdo_fast/vdo/mp4/50/50dc7a2bb8714da38b2c10971fce51d4.mp4",
"_clip": {
"__uuid__": "712e66dd-a0ad-47ce-981b-f05fa133db57"
},
"_volume": 1,
"_mute": false,
"_isFullscreen": true,
"_N$isFullscreen": true,
"_stayOnBottom": true,
"videoPlayerEvent": [],
"_N$keepAspectRatio": true,
"_id": "7fn4AgAtJIZanX7bc/nzLj"
},
{
"__type__": "cc.Node",
"_name": "bg_A",
"_objFlags": 0,
"_parent": {
"__id__": 22
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 26
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 668,
"height": 353
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1.638,
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": "c0NYIsSCZFZr3NPWVwlHAn"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "1519107e-2f68-4aeb-bb2e-d47e9e8785d9"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "12TIQc9L1O1rIp4hQFAqb3"
},
{
"__type__": "cc.Node",
"_name": "text_container",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 28
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-220,
-180,
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": "0frwQYF7lIwIB7eNDQYIcp"
},
{
"__type__": "cc.Node",
"_name": "bg_A",
"_objFlags": 0,
"_parent": {
"__id__": 27
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 29
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 602,
"height": 164
},
"_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": "a97JLq9pVAua7wVjGxeFDh"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "24c5be88-f09f-42aa-bf3c-e0248a81c629"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "7dkqY/AVNGFJQQifsWIdIt"
},
{
"__type__": "cc.Node",
"_name": "right_container",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 31
},
{
"__id__": 33
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 430,
"height": 550
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
378.363,
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": "a9j0dyDaxAWJKitYTpJXu0"
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 30
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 32
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 430,
"height": 550
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-21.293,
14.742,
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": "90aXo7FMVM2rUKSLcGwMV1"
},
{
"__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 22 "__id__": 31
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_materials": [
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b" {
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a9aec2e1-ddd3-414a-8f2d-85f4f3542383"
}, },
"_volume": 1, "_type": 0,
"_mute": false, "_sizeMode": 0,
"_loop": false, "_fillType": 0,
"playOnLoad": false, "_fillCenter": {
"preload": false, "__type__": "cc.Vec2",
"_id": "0adN50f61DlbmppsPkOnjX" "x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "21RVUjN2JMpKnRfsSuUQHI"
},
{
"__type__": "cc.Node",
"_name": "dragonBones",
"_objFlags": 0,
"_parent": {
"__id__": 30
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 34
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 388,
"height": 397
},
"_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": "c65g142Q1Ot5hUwPHKrILy"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "apple",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "cc2fde72-3c3b-4574-9741-c57a28bab1fc#50e92afc-ad08-473d-8aba-ec7911f5fcd1",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "cc2fde72-3c3b-4574-9741-c57a28bab1fc"
},
"_N$dragonAtlasAsset": {
"__uuid__": "50e92afc-ad08-473d-8aba-ec7911f5fcd1"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "bfn3YVOO9LmbRVBrdzSLW/"
}, },
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
...@@ -1259,8 +1798,8 @@ ...@@ -1259,8 +1798,8 @@
"width": 1280, "width": 1280,
"height": 720 "height": 720
}, },
"_fitWidth": false, "_fitWidth": true,
"_fitHeight": false, "_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7" "_id": "59Cd0ovbdF4byw5sbjJDx7"
}, },
{ {
...@@ -1299,5 +1838,63 @@ ...@@ -1299,5 +1838,63 @@
}, },
"_enabled": true, "_enabled": true,
"_id": "e687yyoRBIzZAOVRL8Sseh" "_id": "e687yyoRBIzZAOVRL8Sseh"
},
{
"__type__": "cc.Node",
"_name": "MaskLayer",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_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": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
640,
360,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b7CZqDxDBLX4KJo5K0ULdk"
} }
] ]
\ No newline at end of file
export default class Cartoon {
elements = {
}
touchEventCallback = {
}
audioCallback = {
}
constructor() {
}
audios = {}
audioIDs = {}
initCartoonElement(key, node) {
if(!node) {
console.error("Can not find node for key:[" + key + "]")
}
this.elements[key] = {}
this.elements[key].key = key
this.elements[key].node = node
this.elements[key].initX = node.x
this.elements[key].initY = node.y
this.elements[key].initScaleX = node.scaleX
this.elements[key].initScaleY = node.scaleY
this.elements[key].dragonBones = new DragonBones(node)
this.elements[key]["setLocation"] = (x, y) => {
if(x) {
this.elements[key].initX = x
this.elements[key].node.x = x
}
if(y) {
this.elements[key].initY = y
this.elements[key].node.y = y
}
}
return this.elements[key]
}
getCartoonElement(key) {
let node = this.elements[key]
if(!node) {
console.error("Can't find '" + key + "' node.")
}
return node
}
getSpritNode(nodeName, nameSpace = "") {
let node = cc.find(`${nameSpace}${nodeName}`)
return node?node:null
}
getNodeByName(nodeName, parentNodeName) {
let node = null
if(parentNodeName) {
node = this.getSpritNode(parentNodeName).getChildByName(nodeName)
} else {
node = this.getSpritNode(nodeName)
}
return node?node:null
}
getNodeByPath(path) {
let node = cc.find(path)
if(!node) {
console.warn("Can not fount node.(PATH:" + path + ")")
}
return node?node:null
}
getColor(hex) {
let color = new cc.color()
color.fromHEX(hex);
return color
}
getFontFamily(fontName) {
let font = cc.find(`Canvas/res/font/${fontName}`).getComponent('cc.Label').font;
return font
}
newLabelNode(text, fontFamily, fontSize, color) {
const labelNode = new cc.Node();
labelNode.color = this.getColor(color);
const label = labelNode.addComponent(cc.Label);
label.string = text;
label.fontSize = fontSize;
label.lineHeight = fontSize;
label.font = this.getFontFamily(fontFamily);
return labelNode
}
createFrameAni(imagePath, len) {
let frameAni = new cc.Sprite(imagePath.replace(/_NUM_/g, 1));
frameAni.setPosition(cc.p(cc.winSize.width*0.3, cc.winSize.height/2));
this.addChild(frameAni);
//创建帧动画序列,名词形式
var animation = new cc.Animation();
for (var i = 1; i <= len; i++) {
animation.addSpriteFrameWithFile(imagePath.replace(/_NUM_/g, i));
}
//设置帧动画属性
animation.setDelayPerUnit(2.0 / 4); //每一帧停留的时间
animation.setRestoreOriginalFrame(true); //播放完后回到第一帧
var animate = new cc.Animate(animation);
frameAni.run = () => {
frameAni.runAction(new cc.RepeatForever(animate));
}
}
cloneNode(targetNode) {
var node = cc.instantiate(targetNode);
return node
}
subscribeTouchEvent(key, callBack) {
if(!this.touchEventCallback[key]) {
this.touchEventCallback[key] = callBack
this.elements[key].node.off(cc.Node.EventType.TOUCH_START)
this.elements[key].node.on(cc.Node.EventType.TOUCH_START, ()=>{
if(this.touchEventCallback[key]) {
this.touchEventCallback[key]()
}
})
} else {
this.touchEventCallback[key] = callBack
}
}
initLocalAudios(audioNames = []) {
const audioNode = cc.find('Canvas/res/audio');
const getAudioByResName = (resName) => {
return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
}
audioNames.forEach(audioName=>{
this.audios[audioName] = getAudioByResName(audioName);
})
}
playLocalAudio(audioName, cb) {
let audio = cc.audioEngine.play(this.audios[audioName].clip, false, 0.2)
if (cb) {
this.audioCallback[audio_url] = cb
cc.audioEngine.setFinishCallback(audio, () => {
delete this.audioCallback[audio_url]
cb();
});
}
}
// Audio
playAudio(audio_url, cb = null) {
return new Promise((resolve, reject)=>{
if (audio_url) {
var urlreg=/^(?=^.{3,255}$)(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([\?&]\w+=\w*)*$/
if(urlreg.test(audio_url)) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
if(cb) {
this.audioCallback[audio_url] = cb
}
const audioId = cc.audioEngine.play(audioClip, false, 1);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
delete this.audioCallback[audio_url]
cb();
});
}
this.audioIDs[audio_url] = audioId
resolve(audioId)
});
} else {
const audioNode = cc.find('Canvas/res/audio').getChildByName(audio_url).getComponent(cc.AudioSource);
let audioId = cc.audioEngine.play(audioNode.clip, false, 1)
if (cb) {
this.audioCallback[audio_url] = cb
cc.audioEngine.setFinishCallback(audioId, () => {
delete this.audioCallback[audio_url]
cb();
});
}
this.audioIDs[audio_url] = audioId
resolve(audioId)
}
}
})
}
stopAllAudio(exceptUrls = []) {
for(let key in this.audioIDs) {
if(exceptUrls.indexOf(key) == -1) {
if(this.audioCallback[key]) {
this.audioCallback[key]()
}
if(this.audioIDs[key]) {
cc.audioEngine.stop(this.audioIDs[key])
delete this.audioIDs[key];
}
}
}
}
// Tweenchange
tweenChange(item, obj, time = 0.8, callBack = null, easing = null, update = null) {
const tween = cc.tween(item).to(time, obj).call(()=>{
if(callBack) {
callBack()
}
});
easing && tween.easing(easing);
update && tween.onUpdate((a, b) => { update(a, b); });
tween.start();
return tween;
}
// Common Ani
creatSpeaker(parentNode, nodeName1, nodeName2) {
const sprNode = this.cloneNode(this.getNodeByPath(`Canvas/res/img/${nodeName1}`));
sprNode.parent = parentNode;
sprNode.x = 0;
sprNode.y = 0;
sprNode.zIndex = 2;
parentNode.icon = sprNode;
const sprNode2 = this.cloneNode(this.getNodeByPath(`Canvas/res/img/${nodeName2}`));
sprNode2.parent = sprNode.parent;
sprNode2.x = sprNode.x;
sprNode2.y = sprNode.y;
sprNode2.opacity = 0;
sprNode.spr2 = sprNode2;
// sprNode.addComponent(cc.Button)
// sprNode.on('click', () => {
// this.showSoundAnima(sprNode);
// if(clickCB) {
// clickCB(this)
// }
// playAudioByUrl( item.data.audio_url , () => {
// this.stopSoundAnima(sprNode);
// });
// });
return sprNode
}
showSoundAnima(iconNode, time = 0.4) {
iconNode.isRunAnima = true;
iconNode.spr2.opacity = 255;
iconNode.opacity = 0;
cc.tween(iconNode)
.delay(time / 2)
.call(() => {
iconNode.spr2.opacity = 0;
iconNode.opacity = 255;
})
.delay(time / 2)
.call(() => {
if (iconNode.isRunAnima) {
this.showSoundAnima(iconNode);
}
})
.start()
}
stopSoundAnima(iconNode) {
iconNode.isRunAnima = false;
}
}
class DragonBones {
parentNode = null
_animationLoaded = null
constructor(parentNode) {
this.parentNode = parentNode
}
resetDragonBones() {
const picNode = this.parentNode
if (picNode.animaNode) {
picNode.animaNode.removeFromParent();
this._animationLoaded = null
}
}
setDragonBones(dragonBonesConfig, armatureName, callback, onClickCB) {
const parentNode = this.parentNode
if (parentNode.animaNode) {
parentNode.animaNode.removeFromParent();
}
const animaNode = new cc.Node();
animaNode.parent = parentNode;
parentNode.animaNode = animaNode;
const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
this._animationLoaded = dragonDisplay;
// const image = "http://staging-teach.cdn.ireadabc.com/5a0c5af3e952acd0ac83a6e5c6f03ff1.png";
// const ske = "http://staging-teach.cdn.ireadabc.com/bd825dcceea298d1146be8067ae3d17f.json";
// const atlas = "http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
const image = dragonBonesConfig.texPngData.url
const ske = dragonBonesConfig.skeJsonData.url
const atlas = dragonBonesConfig.texJsonData.url
cc.loader.load(image, (error, texture) => {
cc.loader.load({url: atlas, type: 'txt'}, (error, atlasJson) => {
cc.loader.load({url: ske, type: 'txt'}, (error, dragonBonesJson) => {
// cc.loader.loadRes(image, (error, texture) => {
// console.log(error)
// cc.loader.loadRes(atlas, (error, atlasJson) => {
// console.log(error)
// cc.loader.loadRes(ske, (error, dragonBonesJson) => {
// console.log(error)
// console.log(atlasJson)
const atlas = new dragonBones.DragonBonesAtlasAsset();
atlas.atlasJson = (atlasJson);
atlas.texture = texture;
const asset = new dragonBones.DragonBonesAsset();
asset.dragonBonesJson = (dragonBonesJson);
dragonDisplay.dragonAtlasAsset = atlas;
dragonDisplay.dragonAsset = asset;
let json = JSON.parse(asset.dragonBonesJson);
let armatures = json["armature"];
let armatureNames = [];
for (let i = 0; i < armatures.length; i++) {
armatureNames.push(armatures[i].name);
}
let armatureNameIndex = armatureNames.indexOf(armatureName)
if(armatureNameIndex == -1) {
armatureNameIndex = 0;
}
if (armatureNames.length > 0) {
let defaultArmatureName = armatureNames[armatureNameIndex];
dragonDisplay.armatureName = defaultArmatureName;
let defaultArmature = armatures[armatureNameIndex];
let animations = defaultArmature.animation;
let animationNames = [];
for (let i = 0; i < animations.length; i++) {
animationNames.push(animations[i].name);
}
dragonDisplay.animaNames = animationNames;
animaNode.addComponent(cc.Button)
animaNode.on('click', ()=>{
if(onClickCB) {
onClickCB(this)
}
})
}
if(callback) {
callback(this)
}
let sx = parentNode.width / animaNode.width;
let sy = parentNode.height / animaNode.height;
animaNode.setScale(Math.min(sx, sy));
});
});
});
}
showDragonBones(times = 1, animaName = null) {
let animaNameIndex = this._animationLoaded.animaNames.indexOf(animaName)
if (this._animationLoaded && this._animationLoaded.animaNames.length > 0) {
if(!animaName || animaNameIndex==-1) {
this._animationLoaded.playAnimation(this._animationLoaded.animaNames[0], -1);
} else {
this._animationLoaded.playAnimation(animaName, -1);
}
}
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "799c0c91-0e23-4cf4-8fbf-68bbcf9e1616",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import Cartoon from "./Cartoon"
import defaultData from "./defaultData"
import { jelly } from "./utils"
export default class GameLogic {
g_cartoon = null;
g_formData = null
g_enableClick = true;
g_canvas = null;
g_systemOption = null;
g_useDefaultData = false;
g_curDragonDisplay = null;
m_questionAudioPlayed = false;
m_currentQuestion = -1;
m_questionDone = false;
m_currentQuestionArray = []
m_gameEnd = false;
constructor(formData, systemOption) {
this.g_systemOption = systemOption;
this.g_canvas = cc.find('Canvas');
this.g_cartoon = new Cartoon(cc);
if(!formData.contentObj.dataArray || formData.contentObj.dataArray.length == 0) {
this.g_useDefaultData = true;
this.g_formData = defaultData
console.warn("User default data =>", this.g_formData)
} else {
this.g_formData = formData.contentObj;
console.log("User saved data =>", this.g_formData)
}
this.disableClick("Sysyem_init")
this.g_cartoon.initLocalAudios([])
this.initBg()
this.initNodes();
this.playAudio();
// this.resetPosition();
}
initNodes() {
// let dataLength = this.g_formData.dataArray.length;
// this.g_cartoon.initCartoonElement("title_text", this.g_cartoon.getNodeByPath(`Canvas/title/text`))
// for(let index=0; index<10; index++) {
// const card = this.g_cartoon.initCartoonElement(`card_${index+1}`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}`))
// if(index>=dataLength) {
// card.node.active = false;
// }
// this.g_cartoon.initCartoonElement(`card_${index+1}_star`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/star`));
// this.g_cartoon.initCartoonElement(`card_${index+1}_normal`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/normal`));
// this.g_cartoon.initCartoonElement(`card_${index+1}_selected`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/selected`));
// this.g_cartoon.initCartoonElement(`card_${index+1}_bell`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/bell`))
// this.g_cartoon.initCartoonElement(`card_${index+1}_bell_text`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/bell/index`))
// this.g_cartoon.initCartoonElement(`card_${index+1}_bell_outline`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/bell/bell_outline`));
// this.g_cartoon.initCartoonElement(`card_${index+1}_image_container`, this.g_cartoon.getNodeByPath(`Canvas/card_${index+1}/container/image`));
// }
// if(dataLength==0) {
// this.g_cartoon.getNodeByPath(`Canvas/shengzi/line_1`).active = false;
// this.g_cartoon.getNodeByPath(`Canvas/shengzi/line_2`).active = false;
// } else if(dataLength<=5) {
// this.g_cartoon.getNodeByPath(`Canvas/shengzi/line_2`).active = false;
// }
// this.g_cartoon.initCartoonElement(`snow_container`, this.g_cartoon.getNodeByPath(`Canvas/bgMain/snow_container`));
// this.g_cartoon.initCartoonElement(`bottomButtons`, this.g_cartoon.getNodeByPath(`Canvas/bottomButtons`));
// this.g_cartoon.initCartoonElement(`restart_button`, this.g_cartoon.getNodeByPath(`Canvas/bottomButtons/restart`));
// this.g_cartoon.initCartoonElement(`bird_1`, this.g_cartoon.getNodeByPath(`Canvas/bird_1`));
// this.g_cartoon.initCartoonElement(`bird_2`, this.g_cartoon.getNodeByPath(`Canvas/bird_2`));
// this.g_cartoon.initCartoonElement(`birdStatic_1`, this.g_cartoon.getNodeByPath(`Canvas/bird_1/static`));
// this.g_cartoon.initCartoonElement(`birdStatic_2`, this.g_cartoon.getNodeByPath(`Canvas/bird_2/static`));
// this.g_cartoon.initCartoonElement(`birdAniFly_1`, this.g_cartoon.getNodeByPath(`Canvas/bird_1/fly`));
// this.g_cartoon.initCartoonElement(`birdAniFly_2`, this.g_cartoon.getNodeByPath(`Canvas/bird_2/fly`));
// this.g_cartoon.initCartoonElement(`birdAniWrong_1`, this.g_cartoon.getNodeByPath(`Canvas/bird_1/wrong`));
// this.g_cartoon.initCartoonElement(`birdAniWrong_2`, this.g_cartoon.getNodeByPath(`Canvas/bird_2/wrong`));
// this.g_cartoon.initCartoonElement(`birdAudio`, this.g_cartoon.getNodeByPath(`Canvas/bgMain/bird_audio`));
// this.g_cartoon.initCartoonElement(`birdAudioClickTarget`, this.g_cartoon.getNodeByPath(`Canvas/bgMain/bird_audio/clickTarget`));
// this.g_cartoon.initCartoonElement(`birdAudioNormal`, this.g_cartoon.getNodeByPath(`Canvas/bgMain/bird_audio/normal`));
// this.g_cartoon.initCartoonElement(`birdAudioWrong`, this.g_cartoon.getNodeByPath(`Canvas/bgMain/bird_audio/wrong`));
// this.g_cartoon.initCartoonElement(`birdAudioPlaying`, this.g_cartoon.getNodeByPath(`Canvas/bgMain/bird_audio/playing`));
this.g_cartoon.initCartoonElement(`video_container`, this.g_cartoon.getNodeByPath(`Canvas/video_container`));
this.g_cartoon.initCartoonElement(`video_container_video`, this.g_cartoon.getNodeByPath(`Canvas/video_container/video`));
}
initBg() {
const bgNode_A = cc.find('Canvas/bgMain/bg_A');
bgNode_A.scale = this.g_systemOption.mapScaleMax;
// bgNode_A.height = cc.winSize.height;
// bgNode_A.width = cc.winSize.width;
console.log(bgNode_A.height, bgNode_A.width)
}
playAudio() {
var container = this.g_cartoon.getCartoonElement("video_container_video")
var video = container.node.getComponent(cc.VideoPlayer)
video.play()
}
/*
initBGMusic() {
if(this.g_formData.bgMusic) {
this.g_cartoon.playAudio(this.g_formData.bgMusic).then(audioID => {
cc.audioEngine.setLoop(audioID, true);
cc.audioEngine.setVolume(audioID, 0.3);
})
}
}
resetPosition() {
const bgNodeTitle= cc.find('Canvas/title');
const bgNodeSnow = cc.find('Canvas/bgMain/bg_snow');
const bgNodeShuicao = cc.find('Canvas/bgMain/shuicao');
bgNodeTitle.y = cc.winSize.height / 2 - bgNodeTitle.height / 2 - 50
bgNodeSnow.y = -cc.winSize.height / 2 + bgNodeSnow.height / 2
bgNodeShuicao.y = -cc.winSize.height / 2 + bgNodeShuicao.height / 2
const cardPos = [
{x: -500, y: 128}, {x: -250, y: 128}, {x: 0, y: 128}, {x: 250, y: 128}, {x: 500, y: 128},
{x: -500, y: -114}, {x: -250, y: -114}, {x: 0, y: -114}, {x: 250, y: -114}, {x: 500, y: -114}
]
for(let index=0; index<10; index++) {
const card = this.g_cartoon.getCartoonElement(`card_${index+1}`)
card.node.setPosition(cardPos[index].x, cardPos[index].y)
}
}
initImageCards() {
let dataLength = this.g_formData.dataArray.length;
if(dataLength == 0) {
return
}
let newIndex = [0];
if(dataLength!=1) {
newIndex = this.getRandomArray(dataLength)
}
this.m_currentQuestionArray = []
for(let index=0; index<dataLength; index++) {
this.m_currentQuestionArray.push(index)
}
for (let index = 0; index<dataLength; index++) {
let dataItem = this.g_formData.dataArray[newIndex[index]];
let card = this.g_cartoon.getCartoonElement(`card_${index+1}`)
card.open = false;
let cardNormal = this.g_cartoon.getCartoonElement(`card_${index+1}_normal`)
let cardSelected = this.g_cartoon.getCartoonElement(`card_${index+1}_selected`)
let imageContainer = this.g_cartoon.getCartoonElement(`card_${index+1}_image_container`)
imageContainer.cardIndex = index;
imageContainer.correctIndex = newIndex[index];
let bellOutline = this.g_cartoon.getCartoonElement(`card_${index+1}_bell_outline`)
let bellText = this.g_cartoon.getCartoonElement(`card_${index+1}_bell_text`)
bellText.node.getComponent(cc.Label).font = this.g_cartoon.getFontFamily("Comic Sans MS")
bellText.node.getComponent(cc.Label).fontSize = 20
card.playAudio = (callback) => {
if(dataItem.audio_url) {
this.g_cartoon.playAudio(dataItem.audio_url, ()=>{
if(callback) {
callback()
}
})
} else {
if(callback) {
callback()
}
}
}
if(this.g_useDefaultData || !dataItem) {
let fr = this.getSpriteFrimeByResName("card_demo")
imageContainer.node.setScale(1)
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
} else {
this.getSpriteFrimeByUrl(dataItem.image_url, (fr)=>{
let sx = 220 / fr.getRect().width;
let sy = 110 / fr.getRect().height;
let s = Math.min(sx, sy)
imageContainer.node.width = s * fr.getRect().width;
imageContainer.node.height = s * fr.getRect().height;
imageContainer.node.getComponent(cc.Sprite).spriteFrame = fr
})
}
bellOutline.node.setScale(0);
this.g_cartoon.subscribeTouchEvent(`card_${index+1}_image_container`, ()=>{
if(!this.checkClickEnable()) {
return
}
if(card.open || this.m_gameEnd) {
return;
}
this.disableClick(`card_${index+1}_image_container`)
let birdStandCard = this.g_cartoon.getCartoonElement(`card_${this.m_currentQuestionArray[this.m_currentQuestion]+1}_image_container`)
if(this.m_currentQuestion == imageContainer.correctIndex ) {
this.g_cartoon.playAudio("good_job", ()=>{
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].audio_url)
})
let bell1 = this.g_cartoon.getCartoonElement(`card_${this.m_currentQuestionArray[this.m_currentQuestion]+1}_bell`)
let bell2 = this.g_cartoon.getCartoonElement(`card_${imageContainer.cardIndex+1}_bell`)
this.g_cartoon.tweenChange(bell1.node, {scaleX: 1.2, scaleY: 1.2}, 0.3, ()=>{
this.g_cartoon.tweenChange(bell1.node, {scaleX: 0, scaleY: 0}, 0.4);
});
this.g_cartoon.tweenChange(bell2.node, {scaleX: 1.2, scaleY: 1.2}, 0.3, ()=>{
this.g_cartoon.tweenChange(bell2.node, {scaleX: 0, scaleY: 0}, 0.4);
});
card.open = true;
this.g_cartoon.getCartoonElement(`card_${imageContainer.cardIndex+1}_normal`).node.opacity = 0;
this.g_cartoon.getCartoonElement(`card_${imageContainer.cardIndex+1}_selected`).node.opacity = 255;
this.g_cartoon.getCartoonElement("bird_2").flyTo(imageContainer.cardIndex, ()=>{
this.switchCard(this.m_currentQuestion, imageContainer.cardIndex, ()=>{
this.loadQuestion(()=>{
this.enableClick(`card_${index+1}_image_container`)
})
})
})
} else {
if(birdStandCard.cardIndex != index) {
this.g_cartoon.getCartoonElement("bird_1").wrong()
this.g_cartoon.getCartoonElement("bird_2").wrong()
this.g_cartoon.playAudio("try_again", ()=>{
setTimeout(()=>{
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].audio_url)
this.enableClick(`card_${index+1}_image_container`)
}, 1000)
})
} else {
this.enableClick(`card_${index+1}_image_container`)
}
}
})
card.tweenHandle = null;
const runBell = () => {
bellOutline.node.setScale(1, 1)
bellOutline.node.opacity = 255;
card.tweenHandle = this.g_cartoon.tweenChange(bellOutline.node, {scaleX: 2, scaleY: 2, opacity: 0}, 0.4, ()=>{
runBell()
})
}
const stopBell = () => {
if(card.tweenHandle) {
card.tweenHandle.stop();
card.tweenHandle = null
}
bellOutline.node.setScale(0, 0)
bellOutline.node.opacity = 0;
}
this.g_cartoon.subscribeTouchEvent(`card_${index+1}_bell`, ()=>{
if(!this.checkClickEnable()) {
return
}
if(dataItem.audio_url) {
this.g_cartoon.stopAllAudio([this.g_formData.bgMusic?this.g_formData.bgMusic:""])
card.playAudio(()=>{
stopBell()
})
runBell()
}
})
}
}
switchCard(fromIndex, toIndex, callback) {
let i1 = this.m_currentQuestionArray[fromIndex]+1;
let i2 = this.m_currentQuestionArray[toIndex]
let card_1 = this.g_cartoon.getCartoonElement(`card_${i1}`)
let card_2 = this.g_cartoon.getCartoonElement(`card_${toIndex+1}`)
let cardStar_1 = this.g_cartoon.getCartoonElement(`card_${i1}_star`)
let cardStar_2 = this.g_cartoon.getCartoonElement(`card_${toIndex+1}_star`)
let cardStarAni_1 = this.g_cartoon.getCartoonElement(`card_${i1}_star`).node.getComponent(cc.Animation);
let cardStarAni_2 = this.g_cartoon.getCartoonElement(`card_${toIndex+1}_star`).node.getComponent(cc.Animation);
// console.log("交换",`card_${i1}`,`card_${toIndex+1}`)
let x_1 = card_1.node.x
let y_1 = card_1.node.y
let x_2 = card_2.node.x
let y_2 = card_2.node.y
let bell1 = this.g_cartoon.getCartoonElement(`card_${i1}_bell`)
let bell2 = this.g_cartoon.getCartoonElement(`card_${toIndex+1}_bell`)
this.g_cartoon.playAudio("bird_fly")
this.g_cartoon.tweenChange(card_1.node, {x: x_2, y: y_2}, 1, ()=>{
cardStar_1.node.opacity = 255;
cardStarAni_1.play()
this.g_cartoon.playAudio("star_boom")
cardStarAni_1.on("finished", ()=>{
cardStar_1.node.opacity = 0;
})
this.g_cartoon.tweenChange(bell1.node, {scaleX: 1, scaleY: 1}, 0.2);
});
this.g_cartoon.tweenChange(card_2.node, {x: x_1, y: y_1}, 1, ()=>{
cardStar_2.node.opacity = 255;
cardStarAni_2.play()
cardStarAni_2.on("finished", ()=>{
cardStar_2.node.opacity = 0;
})
this.g_cartoon.tweenChange(bell2.node, {scaleX: 1, scaleY: 1}, 0.2, ()=>{
this.g_cartoon.getCartoonElement("bird_1").flyBack(()=>{
setTimeout(()=>{
if(callback) {
callback();
}
}, 1500)
})
this.g_cartoon.getCartoonElement("bird_2").flyBack()
});
});
let bellText1 = this.g_cartoon.getCartoonElement(`card_${i1}_bell_text`)
let bellText2 = this.g_cartoon.getCartoonElement(`card_${toIndex+1}_bell_text`)
toIndex = this.getCurrentIndex(toIndex)
bellText1.node.getComponent(cc.Label).string = "" + (toIndex+1)
bellText2.node.getComponent(cc.Label).string = "" + (fromIndex+1)
let temp = this.m_currentQuestionArray[fromIndex]
this.m_currentQuestionArray[fromIndex] = this.m_currentQuestionArray[toIndex]
this.m_currentQuestionArray[toIndex] = temp;
}
getCurrentIndex(index) {
return this.m_currentQuestionArray.indexOf(index)
}
initTitle() {
let textNode = this.g_cartoon.getCartoonElement("title_text")
let fontSize = 36
if(this.g_formData.titleText.length>=32 && this.g_formData.titleText.length<48) {
fontSize = 26
} else if(this.g_formData.titleText.length>=48) {
fontSize = 20
}
textNode.node.getComponent(cc.Label).string = this.g_formData.titleText;
textNode.node.getComponent(cc.Label).font = this.g_cartoon.getFontFamily("Comic Sans MS")
textNode.node.getComponent(cc.Label).fontSize = fontSize
textNode.audioID = null
this.g_cartoon.subscribeTouchEvent(textNode.key, ()=>{
if(!this.checkClickEnable()) {
return
}
if(textNode.audioID) {
cc.audioEngine.stop(textNode.audioID);
textNode.audioID = null
}
this.g_cartoon.playAudio(this.g_formData.questionAudio_url).then((audio_id) =>{
textNode.audioID = audio_id
})
})
}
getRandomArray(length) {
Array.prototype.shuffle = function() {
let m = this.length, i;
while (m) {
i = (Math.random() * m--) >>> 0;
[this[m], this[i]] = [this[i], this[m]]
}
return this;
}
const gameLogicCheck = (array, startIndex) => {
let res = true;
for(let index=startIndex; index<array.length; index++) {
let changeIndex = array.indexOf(index)
if(array[index]==index) {
res = false
break;
}
}
return res;
}
let indexArray = []
for(let index=0; index<length; index++) {
indexArray.push(index)
}
var arr = indexArray.shuffle()
var result = false;
var temp = null;
var count = 0;
var arrayCanUse = []
do{
result = false;
arr = indexArray.shuffle()
arrayCanUse = JSON.parse(JSON.stringify(arr))
for(let index=0; index<arr.length; index++) {
if(index==arr[index]) {
result = true;
break
}
}
if(!result) {
for(let index=0; index<arr.length-2; index++) {
var indexChange = arr.indexOf(index)
temp = arr[index]
arr[index] = index;
arr[indexChange] = temp;
if(!gameLogicCheck(arr, index+1)) {
result = true;
break
}
}
}
if(count>20000) {
console.log("已经尝试超过两万次,终止生成", arr)
result = false
}
} while(result)
return arrayCanUse
}
loadQuestion(callback) {
let index = null;
let dataLength = this.g_formData.dataArray.length;
for(let i=0; i<10; i++) {
this.g_cartoon.getCartoonElement(`card_${i+1}_normal`).node.opacity = 255;
this.g_cartoon.getCartoonElement(`card_${i+1}_selected`).node.opacity = 0;
}
this.m_currentQuestion++;
if((this.m_currentQuestion+1)==dataLength) {
this.endGame()
if(callback) {
callback()
}
} else {
index = this.m_currentQuestionArray[this.m_currentQuestion]
console.log(this.m_currentQuestion, index)
this.g_cartoon.getCartoonElement("bird_1").flyTo(index, ()=>{
this.enableClick("bird_1")
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].audio_url)
if(callback) {
callback()
}
})
this.g_cartoon.getCartoonElement(`card_${index+1}_normal`).node.opacity = 0;
this.g_cartoon.getCartoonElement(`card_${index+1}_selected`).node.opacity = 255;
}
}
endGame() {
this.m_gameEnd = true;
// let resetBtn = this.g_cartoon.getCartoonElement("restart_button")
// resetBtn.node.active = true;
}
restartGame(callback) {
let bird_1 = this.g_cartoon.getCartoonElement("bird_1");
let bird_2 = this.g_cartoon.getCartoonElement("bird_2");
if(bird_1.up) {
bird_1.flyBack()
}
if(bird_2.up) {
bird_2.flyBack()
}
this.m_questionAudioPlayed = false;
this.m_currentQuestion = -1;
this.m_questionDone = false;
this.m_currentQuestionArray = []
this.m_gameEnd = false;
for(let index=0; index<10; index++) {
const card = this.g_cartoon.getCartoonElement(`card_${index+1}`)
}
this.g_cartoon.stopAllAudio([this.g_formData.bgMusic?this.g_formData.bgMusic:""])
this.showMaskLayer(()=>{
this.resetPosition();
this.initImageCards();
this.initTitle();
this.hideMaskLayer(()=>{
this.loadQuestion(()=>{
if(callback) {
callback()
}
});
})
})
}
initBottomButtons() {
let bottomButtons = this.g_cartoon.getCartoonElement("bottomButtons")
bottomButtons.node.x = cc.winSize.width / 2 - 100
bottomButtons.node.y = -cc.winSize.height / 2 + 50
let resetBtn = this.g_cartoon.getCartoonElement("restart_button")
this.g_cartoon.subscribeTouchEvent(resetBtn.key, ()=>{
if(!this.checkClickEnable()) {
return
}
this.disableClick(resetBtn.key)
resetBtn.node.opacity = 128;
jelly(resetBtn.node)
this.restartGame(()=>{
this.enableClick(resetBtn.key)
resetBtn.node.opacity = 255;
})
})
}
initBirds() {
let bird_1 = this.g_cartoon.getCartoonElement("bird_1");
let bird_2 = this.g_cartoon.getCartoonElement("bird_2");
let birdAniFly_1 = this.g_cartoon.getCartoonElement("birdAniFly_1");
let birdAniFly_2 = this.g_cartoon.getCartoonElement("birdAniFly_2");
let birdStatic_1 = this.g_cartoon.getCartoonElement("birdStatic_1");
let birdStatic_2 = this.g_cartoon.getCartoonElement("birdStatic_2");
let birdAniWrong_1 = this.g_cartoon.getCartoonElement("birdAniWrong_1");
let birdAniWrong_2 = this.g_cartoon.getCartoonElement("birdAniWrong_2");
let birdAudioClickTarget = this.g_cartoon.getCartoonElement("birdAudioClickTarget");
let birdAudio = this.g_cartoon.getCartoonElement("birdAudio");
let birdAudioNormal = this.g_cartoon.getCartoonElement("birdAudioNormal");
let birdAudioWrong = this.g_cartoon.getCartoonElement("birdAudioWrong");
let birdAudioPlaying = this.g_cartoon.getCartoonElement("birdAudioPlaying");
// Normal
birdAniFly_1.node.opacity = 0;
birdAniFly_2.node.opacity = 0;
// Wrong
birdAniWrong_1.node.opacity = 0;
birdAniWrong_2.node.opacity = 0;
birdAudioWrong.node.opacity = 0;
birdAudioPlaying.node.opacity = 0;
birdAudio.switchAni = (type) => {
switch(type) {
case 0:
birdAudioNormal.node.opacity = 255;
birdAudioWrong.node.opacity = 0;
birdAudioPlaying.node.opacity = 0;
break;
case 1:
birdAudioNormal.node.opacity = 0;
birdAudioWrong.node.opacity = 255;
birdAudioPlaying.node.opacity = 0;
break;
case 2:
birdAudioNormal.node.opacity = 0;
birdAudioWrong.node.opacity = 0;
birdAudioPlaying.node.opacity = 255;
break;
default:
birdAudioNormal.node.opacity = 255;
birdAudioWrong.node.opacity = 0;
birdAudioPlaying.node.opacity = 0;
break;
}
}
bird_1.flyTo = (cardIndex, callback)=>{
this.g_cartoon.playAudio("bird_fly")
let card = this.g_cartoon.getCartoonElement(`card_${cardIndex+1}`)
card.node.setSiblingIndex(100)
const worldPos = cc.find("Canvas").convertToWorldSpaceAR(cc.v2(bird_1.node.x, bird_1.node.y));
const localPos = card.node.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
bird_1.node.x = localPos.x;
bird_1.node.y = localPos.y;
bird_1.node.parent = card.node;
birdAniFly_1.node.opacity = 255;
birdStatic_1.node.opacity = 0;
bird_1.up = true;
this.g_cartoon.tweenChange(bird_1.node, {x: -80, y: 90}, 1, ()=>{
birdAniFly_1.node.opacity = 0;
birdStatic_1.node.opacity = 255;
if(callback) {
callback()
}
})
}
bird_1.flyBack = (callback)=>{
this.g_cartoon.playAudio("bird_fly")
let parent = bird_1.node.parent
const worldPos = parent.convertToWorldSpaceAR(cc.v2(bird_1.node.x, bird_1.node.y));
const localPos = cc.find("Canvas").convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
bird_1.node.x = localPos.x;
bird_1.node.y = localPos.y;
bird_1.node.parent = cc.find("Canvas");
birdAniFly_1.node.opacity = 255;
birdStatic_1.node.opacity = 0;
bird_1.up = false;
this.g_cartoon.tweenChange(bird_1.node, {x: -100, y: -cc.winSize.height / 2 + bird_2.node.height + 10}, 0.5, ()=>{
birdAniFly_1.node.opacity = 0;
birdStatic_1.node.opacity = 255;
if(callback) {
callback()
}
})
}
bird_2.flyTo = (cardIndex, callback)=>{
this.g_cartoon.playAudio("bird_fly")
let card = this.g_cartoon.getCartoonElement(`card_${cardIndex+1}`)
card.node.setSiblingIndex(100)
const worldPos = cc.find("Canvas").convertToWorldSpaceAR(cc.v2(bird_2.node.x, bird_2.node.y));
const localPos = card.node.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
bird_2.node.x = localPos.x;
bird_2.node.y = localPos.y;
bird_2.node.parent = card.node;
birdAniFly_2.node.opacity = 255;
birdStatic_2.node.opacity = 0;
bird_2.up = true;
this.g_cartoon.tweenChange(bird_2.node, {x: 80, y: 90}, 1, ()=>{
birdAniFly_2.node.opacity = 0;
birdStatic_2.node.opacity = 255;
if(callback) {
callback()
}
})
}
bird_2.flyBack = (callback)=>{
let parent = bird_2.node.parent
const worldPos = parent.convertToWorldSpaceAR(cc.v2(bird_2.node.x, bird_2.node.y));
const localPos = cc.find("Canvas").convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
bird_2.node.x = localPos.x;
bird_2.node.y = localPos.y;
bird_2.node.parent = cc.find("Canvas");
birdAniFly_2.node.opacity = 255;
birdStatic_2.node.opacity = 0;
bird_2.up = false;
this.g_cartoon.tweenChange(bird_2.node, {x: 105, y: -cc.winSize.height / 2 + bird_2.node.height}, 0.5, ()=>{
birdAniFly_2.node.opacity = 0;
birdStatic_2.node.opacity = 255;
if(callback) {
callback()
}
})
}
bird_1.wrong = ()=>{
birdAniWrong_1.node.opacity = 255;
birdStatic_1.node.opacity = 0;
birdAudio.switchAni(1)
setTimeout(() => {
birdAniWrong_1.node.opacity = 0;
birdStatic_1.node.opacity = 255;
birdAudio.switchAni(0)
}, 1000);
}
bird_2.wrong = ()=>{
birdAniWrong_2.node.opacity = 255;
birdStatic_2.node.opacity = 0;
setTimeout(() => {
birdAniWrong_2.node.opacity = 0;
birdStatic_2.node.opacity = 255;
}, 1000);
}
bird_1.node.y = -cc.winSize.height / 2 + bird_1.node.height + 10
bird_2.node.y = -cc.winSize.height / 2 + bird_2.node.height
birdAudio.node.y = -cc.winSize.height / 2 + bird_2.node.height + 20
birdAudio.audioID = null
this.g_cartoon.subscribeTouchEvent(birdAudioClickTarget.key, ()=>{
if(!this.checkClickEnable()) {
return
}
if(birdAudio.audioID) {
cc.audioEngine.stop(birdAudio.audioID);
birdAudio.audioID = null;
}
if(this.m_currentQuestion!=-1 && this.g_formData.dataArray[this.m_currentQuestion].audio_url) {
birdAudio.switchAni(2)
this.g_cartoon.playAudio(this.g_formData.dataArray[this.m_currentQuestion].audio_url, ()=>{
birdAudio.switchAni(0)
}).then(audio_id=>{
birdAudio.audioID = audio_id
})
}
})
}
snowing(time=5000) {
const parent = this.g_cartoon.getCartoonElement("snow_container")
const downHeigth = parent.node.height / 2 + 50
console.log(downHeigth, this.g_systemOption.mapScaleMax)
const getSnow = (index) => {
const snowArray = [
this.getSprNode('snow_1'), this.getSprNode('snow_2'), this.getSprNode('snow_3'), this.getSprNode('snow_4')
]
const sf = this.getSprNode(`snow_${index}`).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
node.y = downHeigth
node.x = Math.ceil(Math.random() * cc.winSize.width) - cc.winSize.width / 2
node.parent = parent.node
return node;
}
const downTime = Math.ceil((cc.winSize.height / 100) * 1000) / 1000
console.log(downTime)
let intervalID = setInterval(() => {
let snow = getSnow( Math.ceil(Math.random()*4) )
// this.g_cartoon.tweenChange(snow, {y: -cc.winSize.height / 2}, downTime)
cc.tween(snow).to(downTime, {y: -cc.winSize.height / 2}).call(()=>snow.destroy()).start()
}, 100);
// setTimeout(() => {
// clearInterval(intervalID)
// }, time);
}
*/
// Common function
maskLayer = null;
initMaskLayer() {
const parentNode = this.g_cartoon.getNodeByPath("MaskLayer")
parentNode.x = cc.winSize.width / 2
parentNode.y = cc.winSize.height / 2
const bNode = this.getSprNode('black');
bNode.scaleX = cc.winSize.width / bNode.width;
bNode.scaleY = cc.winSize.height / bNode.height;
bNode.x = 0
bNode.y = 0
parentNode.setSiblingIndex(255)
bNode.parent = cc.find('MaskLayer');
bNode.active = false;
this.maskLayer = bNode;
}
showMaskLayer(cb) {
this.maskLayer.opacity = 0;
this.maskLayer.active = true;
cc.tween(this.maskLayer)
.to(0.5, {opacity: 255}, {easing: 'sineOut'})
.call(() => {
cb()
})
.start()
}
hideMaskLayer(cb = null) {
this.maskLayer.opacity = 255;
cc.tween(this.maskLayer)
.to(0.5, {opacity: 0}, {easing: 'sineIn'})
.call(() => {
this.maskLayer.active = false;
if (cb) {
cb()
}
})
.start()
}
// Common API
getSpriteFrimeByUrl(url, cb) {
cc.assetManager.loadRemote(url, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
}
getSpriteFrimeByResName(name) {
const sf = cc.find('Canvas/res/img/' + name).getComponent(cc.Sprite).spriteFrame;
// const node = new cc.Node();
// node.addComponent(cc.Sprite).spriteFrame = sf;
return sf;
}
getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
}
// Sysyem function
checkClickEnable(eventName) {
if(this.g_enableClick) {
return true;
} else {
console.log(`Click disabled by event [${this.g_disableClickEventName}]!`)
return false;
}
}
disableClick(eventName) {
this.g_enableClick = false;
this.g_disableClickEventName = eventName
console.log(`Click disabled! [${eventName}]`)
}
enableClick(eventName) {
this.g_enableClick = true;
this.g_disableClickEventName = ""
console.log(`Click enabled! [${eventName}]`)
}
}
{
"ver": "1.0.8",
"uuid": "356c544f-5ce9-4cbb-a2c1-c0737e0a02e2",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks: // Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import GameLogic from "./GameLogic"
cc.Class({ cc.Class({
extends: cc.Component, extends: cc.Component,
gameLogic: null,
properties: { properties: {
}, },
// 生命周期 onLoad // 生命周期 onLoad
...@@ -67,20 +67,34 @@ cc.Class({ ...@@ -67,20 +67,34 @@ cc.Class({
} }
getData((data) => { getData((data) => {
console.log('data:', data);
this.data = data || this.getDefaultData(); this.data = data || this.getDefaultData();
this.data = JSON.parse(JSON.stringify(this.data)) this.data = JSON.parse(JSON.stringify(this.data))
this.preloadItem() this.preloadItem()
// 添加游戏逻辑
this.gameLogic = new GameLogic(this.data, {
designSize: this._designSize,
frameSize: this._frameSize,
mapScaleMin: this._mapScaleMin,
mapScaleMax: this._mapScaleMax,
cocosScale: this._cocosScale,
});
}) })
}, },
onDestory() {
cc.audioEngine.stopAll()
},
getData(cb) { getData(cb) {
cb(this.getDefaultData()); cb(this.getDefaultData());
}, },
getDefaultData() { getDefaultData() {
// const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbox_FT_08","bgMusic":"","titleText":"TEstd","questionAudio_url":"","dataArray":[{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/06cc843598a912921f6ca3acfde6220b.png","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/571974922f6678111348a5643dba7e20.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/78579114773af12a7aec6723e3b9d475.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/c99e82e1c3f087c6dc0469e30c624f70.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/5b45c89ac9e899d76522767219b1346b.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/2e28eae8f0e0f01193da6f3677379ed3.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/fad2dac4f8b59a185dc30d42617c2ca8.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/6c3fca11052464102407f173e4a83db9.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/ec82c796af801486548ae98623f614d2.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/ac4b9422df1556f80ac5c3058cd3d670.png"}]}}'
const dataJson = '{"pic_url":"http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png","pic_url_2":"http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png","text":"This is a test label.","audio_url":"http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3"}' // const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbox_FT_08","bgMusic":"http://staging-teach.cdn.ireadabc.com/ad58bae62ea02cf215ce7dee22df306f.mp3","titleText":"TEstd","questionAudio_url":"http://staging-teach.cdn.ireadabc.com/2bf96923b83ee0c5f20930386ce07384.mp3","dataArray":[{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/06cc843598a912921f6ca3acfde6220b.png","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/571974922f6678111348a5643dba7e20.png","audio_url":"http://staging-teach.cdn.ireadabc.com/ae7c0930a45d0ffc9f13182298e2be71.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/78579114773af12a7aec6723e3b9d475.png","audio_url":"http://staging-teach.cdn.ireadabc.com/c14938125a52096dc0be9fbbf6638cb2.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/c99e82e1c3f087c6dc0469e30c624f70.png","audio_url":"http://staging-teach.cdn.ireadabc.com/135c628899396df62c14567f46d61f3f.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/5b45c89ac9e899d76522767219b1346b.png","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/2e28eae8f0e0f01193da6f3677379ed3.png","audio_url":"http://staging-teach.cdn.ireadabc.com/cb0ac1d1bcdfdaf768f0a06d3fff37a3.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/fad2dac4f8b59a185dc30d42617c2ca8.png","audio_url":"http://staging-teach.cdn.ireadabc.com/9df3f14bc88bcffc49b6717c40428ed8.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/6c3fca11052464102407f173e4a83db9.png","audio_url":"http://staging-teach.cdn.ireadabc.com/d5a5ac2f45431a8a15492cb9f78e0396.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/ec82c796af801486548ae98623f614d2.png","audio_url":"http://staging-teach.cdn.ireadabc.com/fb08783926362bf64232e2ec6966011d.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/ac4b9422df1556f80ac5c3058cd3d670.png","audio_url":"http://staging-teach.cdn.ireadabc.com/fb08783926362bf64232e2ec6966011d.mp3"}]}}'
// const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbox_FT_08","bgMusic":"http://staging-teach.cdn.ireadabc.com/2bf96923b83ee0c5f20930386ce07384.mp3","titleText":"TEstd","questionAudio_url":"http://staging-teach.cdn.ireadabc.com/2bf96923b83ee0c5f20930386ce07384.mp3","dataArray":[{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/06cc843598a912921f6ca3acfde6220b.png","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/571974922f6678111348a5643dba7e20.png","audio_url":"http://staging-teach.cdn.ireadabc.com/ae7c0930a45d0ffc9f13182298e2be71.mp3"}]}}'
const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbox_FT_08","bgMusic":"","titleText":"","questionAudio_url":"","dataArray":[]}}'
const data = JSON.parse(dataJson); const data = JSON.parse(dataJson);
return data; return data;
}, },
...@@ -95,8 +109,15 @@ cc.Class({ ...@@ -95,8 +109,15 @@ cc.Class({
addPreloadImage() { addPreloadImage() {
this._imageResList.push({ url: this.data.pic_url }); if (!this.data.dataArray) {
this._imageResList.push({ url: this.data.pic_url_2 }); return;
}
this.data.dataArray.forEach(item=>{
this._imageResList.push({ url: item.question.centerImage_url});
})
}, },
addPreloadAudio() { addPreloadAudio() {
...@@ -105,7 +126,16 @@ cc.Class({ ...@@ -105,7 +126,16 @@ cc.Class({
}, },
addPreloadAnima() { addPreloadAnima() {
if (!this.data.dataArray) {
return;
}
this.data.dataArray.forEach((item) => {
if (item.dragonBones) {
this._animaResList.push({url: item.dragonBones.skeJsonData.url});
this._animaResList.push({url: item.dragonBones.texJsonData.url});
this._animaResList.push({url: item.dragonBones.texPngData.url});
}
})
}, },
preload() { preload() {
...@@ -125,9 +155,6 @@ cc.Class({ ...@@ -125,9 +155,6 @@ cc.Class({
loadEnd() { loadEnd() {
this.initData(); this.initData();
this.initAudio();
this.initView();
// this.initListener();
}, },
_cantouch: null, _cantouch: null,
...@@ -136,167 +163,6 @@ cc.Class({ ...@@ -136,167 +163,6 @@ cc.Class({
this._cantouch = true; this._cantouch = true;
}, },
audioBtn: null,
initAudio() {
const audioNode = cc.find('Canvas/res/audio');
const getAudioByResName = (resName) => {
return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
}
this.audioBtn = getAudioByResName('btn');
},
initView() {
this.initBg();
this.initPic();
this.initBtn();
this.initIcon();
},
initBg() {
const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax;
},
pic1: null,
pic2: null,
initPic() {
const canvas = cc.find('Canvas');
const maxW = canvas.width * 0.7;
this.getSprNodeByUrl(this.data.pic_url, (sprNode) => {
const picNode1 = sprNode;
picNode1.scale = maxW / picNode1.width;
picNode1.baseX = picNode1.x;
canvas.addChild(picNode1);
this.pic1 = picNode1;
const labelNode = new cc.Node();
labelNode.color = cc.Color.YELLOW;
const label = labelNode.addComponent(cc.Label);
label.string = this.data.text;
label.fontSize = 60;
label.lineHeight = 60;
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font;
picNode1.addChild(labelNode);
});
this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => {
const picNode2 = sprNode;
picNode2.scale = maxW / picNode2.width;
canvas.addChild(picNode2);
picNode2.x = canvas.width;
picNode2.baseX = picNode2.x;
this.pic2 = picNode2;
const labelNode = new cc.Node();
const label = labelNode.addComponent(cc.RichText);
const size = 60
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent(cc.Label).font;
label.string = `<outline color=#751e00 width=4><size=${size}><color=#ffffff>${this.data.text}</color></size></outline>`
label.lineHeight = size;
picNode2.addChild(labelNode);
});
},
initIcon() {
const iconNode = this.getSprNode('icon');
iconNode.zIndex = 5;
iconNode.anchorX = 1;
iconNode.anchorY = 1;
iconNode.parent = cc.find('Canvas');
iconNode.x = iconNode.parent.width / 2 - 10;
iconNode.y = iconNode.parent.height / 2 - 10;
iconNode.on(cc.Node.EventType.TOUCH_START, () => {
this.playAudioByUrl(this.data.audio_url);
})
},
curPage: null,
initBtn() {
this.curPage = 0;
const bottomPart = cc.find('Canvas/bottomPart');
bottomPart.zIndex = 5; // 提高层级
bottomPart.x = bottomPart.parent.width / 2;
bottomPart.y = -bottomPart.parent.height / 2;
const leftBtnNode = bottomPart.getChildByName('btn_left');
//节点中添加了button组件 则可以添加click事件监听
leftBtnNode.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 0) {
return;
}
this.curPage = 0
this.leftMove();
cc.audioEngine.play(this.audioBtn.clip, false, 0.8)
})
const rightBtnNode = bottomPart.getChildByName('btn_right');
//节点中添加了button组件 则可以添加click事件监听
rightBtnNode.on('click', () => {
if (!this._cantouch) {
return;
}
if (this.curPage == 1) {
return;
}
this.curPage = 1
this.rightMove();
cc.audioEngine.play(this.audioBtn.clip, false, 0.5)
})
},
leftMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' })
.start();
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' })
.call(() => {
this._cantouch = true;
})
.start();
},
rightMove() {
this._cantouch = false;
const len = this.pic1.parent.width;
cc.tween(this.pic1)
.to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' })
.start();
cc.tween(this.pic2)
.to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' })
.call(() => {
this._cantouch = true;
})
.start();
},
// update (dt) {},
...@@ -322,9 +188,16 @@ cc.Class({ ...@@ -322,9 +188,16 @@ cc.Class({
return node; return node;
}, },
getSprNode(resName) {
const sf = cc.find(resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
},
getSpriteFrimeByUrl(url, cb) { getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => { cc.assetManager.loadRemote(url, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img) const spriteFrame = new cc.SpriteFrame(img)
if (cb) { if (cb) {
cb(spriteFrame); cb(spriteFrame);
......
export default {
"default": true,
"version":"1.0",
"key":"DataKey_Sbox_FT_08",
"bgMusic":"",
"titleText":"It's My Day",
"questionAudio_url":"",
"dataArray":[
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
{
"image_url":"card_demo",
"audio_url":""
},
]
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "045d28a3-8121-42c8-9c5b-d8a5e06fcebf",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
...@@ -118,7 +118,8 @@ export async function asyncPlayEffectByUrl(url, loop = false) { ...@@ -118,7 +118,8 @@ export async function asyncPlayEffectByUrl(url, loop = false) {
}); });
} }
export async function jelly(node) { export function jelly(node) {
console.log("Jelly")
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
cc.tween(node) cc.tween(node)
.to(0.1, { scaleX: 0.9, scaleY: 1.1 }) .to(0.1, { scaleX: 0.9, scaleY: 1.1 })
......
{
"ver": "2.3.5",
"uuid": "3cd1fdec-4903-4d46-90dc-2fc77c4fb40f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 430,
"height": 550,
"platformSettings": {},
"subMetas": {
"bgRight": {
"ver": "1.0.4",
"uuid": "a9aec2e1-ddd3-414a-8f2d-85f4f3542383",
"rawTextureUuid": "3cd1fdec-4903-4d46-90dc-2fc77c4fb40f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 214.5,
"offsetY": -274.5,
"trimX": 429,
"trimY": 549,
"width": 1,
"height": 1,
"rawWidth": 430,
"rawHeight": 550,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b", "uuid": "ccc67bab-a66a-48e6-accc-dd8a0b686f19",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
"height": 720, "height": 720,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg": { "bg_bg_A": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd", "uuid": "8fca9173-2c3b-4a8a-a2fe-3c97908a3bd9",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b", "rawTextureUuid": "ccc67bab-a66a-48e6-accc-dd8a0b686f19",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
......
{
"ver": "2.3.5",
"uuid": "ab4418f0-0475-4af7-a944-5396cfb0301c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 720,
"platformSettings": {},
"subMetas": {
"bg_bg_new_A": {
"ver": "1.0.4",
"uuid": "efc7ad6f-e504-4a62-b16d-aefef18faad3",
"rawTextureUuid": "ab4418f0-0475-4af7-a944-5396cfb0301c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 720,
"rawWidth": 1280,
"rawHeight": 720,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "uuid": "2c39f57a-a5c6-4a2f-baa7-c9bdd9d8ef0d",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 366, "width": 668,
"height": 336, "height": 353,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"1orange": { "bg_kuang_A": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa", "uuid": "1519107e-2f68-4aeb-bb2e-d47e9e8785d9",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "rawTextureUuid": "2c39f57a-a5c6-4a2f-baa7-c9bdd9d8ef0d",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": -0.5, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 1, "trimY": 0,
"width": 366, "width": 668,
"height": 335, "height": 353,
"rawWidth": 366, "rawWidth": 668,
"rawHeight": 336, "rawHeight": 353,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "5b4826b6-5dd3-4c7d-bef7-6ae8cf7680a5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1210,
"height": 478,
"platformSettings": {},
"subMetas": {
"bg_pao_A": {
"ver": "1.0.4",
"uuid": "2ecbaeb7-1546-4264-91fc-471289a5404e",
"rawTextureUuid": "5b4826b6-5dd3-4c7d-bef7-6ae8cf7680a5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1210,
"height": 478,
"rawWidth": 1210,
"rawHeight": 478,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2a8e0ff2-3431-4287-ac5c-0bb54f25d92b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 602,
"height": 164,
"platformSettings": {},
"subMetas": {
"bg_word_A": {
"ver": "1.0.4",
"uuid": "24c5be88-f09f-42aa-bf3c-e0248a81c629",
"rawTextureUuid": "2a8e0ff2-3431-4287-ac5c-0bb54f25d92b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 602,
"height": 164,
"rawWidth": 602,
"rawHeight": 164,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "uuid": "5ef6135d-2395-4377-b3d5-549b3d458bee",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 100,
"height": 67, "height": 100,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_left": { "black": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5", "uuid": "7a2d99d6-2009-4341-83f8-f18980e6405d",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "rawTextureUuid": "5ef6135d-2395-4377-b3d5-549b3d458bee",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 61, "width": 100,
"height": 67, "height": 100,
"rawWidth": 61, "rawWidth": 100,
"rawHeight": 67, "rawHeight": 100,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "uuid": "2415e777-ac95-43f5-a9e9-14a21908331e",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 61, "width": 47,
"height": 67, "height": 57,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_right": { "btn_restart": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59", "uuid": "607a2f52-a26c-434f-b331-afa9335ca6e6",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "rawTextureUuid": "2415e777-ac95-43f5-a9e9-14a21908331e",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": -0.5, "offsetX": 0,
"offsetY": 0.5, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 60, "width": 47,
"height": 66, "height": 57,
"rawWidth": 61, "rawWidth": 47,
"rawHeight": 67, "rawHeight": 57,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"platformSettings": {},
"subMetas": {
"icon": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"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