Commit 9e771768 authored by 杨一航's avatar 杨一航

feat: v1.0

parent a3f5ba9f
{
"ver": "1.1.2",
"uuid": "109f5706-180c-4588-8040-3af1c7d07b3c",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "dc5c86bb-6901-41a4-8517-9694a1422a85",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "f528cb2d-4d1d-4957-b587-6e5ba0fe047f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "9aee0bb5-ae33-43e7-b817-e35fbe1d8ac0",
"downloadMode": 0,
"duration": 0.182857,
"subMetas": {}
}
\ No newline at end of file
{"frameRate":30,"name":"DG24_leaves_left","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"Armature","aabb":{"x":-295.32,"y":-157,"width":500.56,"height":399},"bone":[{"name":"root"},{"length":108,"name":"bone","parent":"root","transform":{"x":-224.3,"y":228.6,"skX":-51.1512,"skY":-51.1512}},{"length":147,"name":"3","parent":"root","transform":{"x":-274.6,"y":237.25,"skX":-82.9886,"skY":-82.9886}},{"length":70,"name":"1","parent":"root","transform":{"x":28.05,"y":225,"skX":-66.0416,"skY":-66.0416}},{"length":74,"name":"11","parent":"1","transform":{"x":70.8001,"skX":5.3078,"skY":5.3078}},{"length":93,"name":"2","parent":"bone","transform":{"x":108.8849,"skX":1.1833,"skY":1.1833}},{"length":116,"name":"31","parent":"3","transform":{"x":147.0497,"skX":3.3265,"skY":3.3265}},{"length":88,"name":"21","parent":"2","transform":{"x":93.903,"skX":2.3352,"skY":2.3352}},{"length":90,"name":"12","parent":"11","transform":{"x":74.9692,"skX":8.6144,"skY":8.6144}},{"length":127,"name":"32","parent":"31","transform":{"x":116.1861,"skX":3.0807,"skY":3.0807}}],"slot":[{"name":"3","parent":"32"},{"name":"2","parent":"21"},{"name":"1","parent":"12"}],"skin":[{"slot":[{"name":"3","display":[{"type":"mesh","name":"DG24_leaves_left/3","width":138,"height":399,"vertices":[-273.7,243.55,-223.05,243.55,-187.35,221.3,-160.3,189.1,-157,157.45,-157,130.95,-163.2,90.1,-169.5,45.85,-174.15,6.75,-175.85,-28.35,-181.6,-71.6,-183.9,-107.85,-189.1,-135.45,-194.85,-155.5,-214.95,-155.5,-237.4,-132.6,-254.65,-99.8,-269.55,-67.55,-279.4,-34.2,-286.9,-0.8,-291.5,32,-295,69.95,-295,109.15,-295,149.95,-292.1,187.95,-282.3,216.7],"uvs":[0.15435,1.00013,0.52138,1.00013,0.78007,0.94436,0.97609,0.86366,1,0.78434,1,0.71792,0.95507,0.61554,0.90942,0.50464,0.87572,0.40664,0.86341,0.31867,0.82174,0.21028,0.80507,0.11942,0.76739,0.05025,0.72572,0,0.58007,0,0.41739,0.05739,0.29239,0.1396,0.18442,0.22043,0.11304,0.30401,0.0587,0.38772,0.02536,0.46992,0,0.56504,0,0.66328,0,0.76554,0.02101,0.86078,0.09203,0.93283],"triangles":[2,3,4,23,2,4,6,22,5,22,23,5,23,4,5,23,24,2,7,21,6,21,22,6,8,20,7,20,21,7,24,25,2,10,17,9,9,18,8,18,19,8,19,20,8,17,18,9,25,1,2,11,16,10,16,17,10,12,15,11,15,16,11,13,14,12,14,15,12,25,0,1],"weights":[1,2,1,1,2,1,2,2,0.93,6,0.07,2,2,0.619619,6,0.380381,3,2,0.477288,6,0.381826,9,0.140886,3,2,0.435621,6,0.407623,9,0.156756,3,2,0.396497,6,0.411743,9,0.19176,3,2,0.272914,6,0.438329,9,0.288757,3,2,0.139139,6,0.446208,9,0.414653,3,2,0.076036,9,0.486901,6,0.437062,3,2,0.038776,9,0.726678,6,0.234546,2,9,0.912818,6,0.087182,2,9,0.97549,6,0.02451,2,9,0.989119,6,0.010881,2,9,0.991495,6,0.008505,2,9,0.943012,6,0.056988,3,2,0.028761,9,0.803893,6,0.167345,3,2,0.043978,9,0.599822,6,0.3562,3,2,0.058598,9,0.470913,6,0.470489,3,2,0.118755,6,0.521382,9,0.359863,3,2,0.242737,6,0.569632,9,0.187631,3,2,0.439525,6,0.49069,9,0.069785,3,2,0.561466,6,0.404053,9,0.03448,3,2,0.817614,6,0.159018,9,0.023368,2,2,0.950923,6,0.049077,1,2,1],"slotPose":[1,0,0,1,0,0],"bonePose":[2,0.122068,-0.992522,0.992522,0.122068,-274.6,237.25,6,0.179453,-0.983766,0.983766,0.179453,-256.65,91.3,9,0.232064,-0.972701,0.972701,0.232064,-235.8,-23],"edges":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,0],"userEdges":[]}]},{"name":"2","display":[{"type":"mesh","name":"DG24_leaves_left/2","width":218,"height":249,"vertices":[-241,228.5,-101.55,228.5,-77.95,202.85,-58.4,167.75,-42.85,138.95,-31.35,112.5,-24.45,83.75,-23,52.65,-23.3,21,-30.2,-13.5,-52.65,-20.5,-83.15,-20.5,-116.5,-10.05,-152.2,10.05,-181.55,33.1,-207.45,57.85,-228.75,80.85,-241,96.95],"uvs":[0,1,0.63968,1,0.74794,0.89699,0.83761,0.75602,0.90894,0.64036,0.9617,0.53414,0.99335,0.41867,1,0.29378,0.99862,0.16667,0.96697,0.02811,0.86399,0,0.72408,0,0.5711,0.04197,0.40734,0.12269,0.27271,0.21526,0.1539,0.31466,0.05619,0.40703,0,0.47169],"triangles":[13,6,7,12,13,7,11,12,7,11,7,8,10,11,8,9,10,8,13,5,6,14,4,5,13,14,5,14,15,3,14,3,4,15,16,3,16,2,3,17,0,1,17,1,2,16,17,2],"weights":[1,1,1,1,1,1,3,5,0.34,7,0.17,1,0.49,3,5,0.43,7,0.32,1,0.25,2,5,0.510632,7,0.489368,2,7,0.508609,5,0.491391,2,7,0.58969,5,0.41031,2,7,0.776716,5,0.223284,2,7,0.956171,5,0.043829,2,7,0.962954,5,0.037046,2,7,0.912149,5,0.087851,2,7,0.758307,5,0.241693,2,7,0.591889,5,0.408111,2,7,0.50277,5,0.49723,2,5,0.519091,7,0.480909,3,5,0.45,7,0.3,1,0.25,3,5,0.34,7,0.17,1,0.49,1,1,1],"slotPose":[1,0,0,1,0,0],"bonePose":[1,0.627268,-0.778804,0.778804,0.627268,-224.3,228.6,5,0.643217,-0.765684,0.765684,0.643217,-156,143.8,7,0.673881,-0.73884,0.73884,0.673881,-95.6,71.9],"edges":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,0],"userEdges":[]}]},{"name":"1","display":[{"type":"mesh","name":"DG24_leaves_left/1","width":204,"height":206,"vertices":[-39.05,225.5,-21.15,184.8,3.6,143.05,28,105.15,60.45,64.85,87.15,39.6,112.05,22.55,129.4,19.5,152.85,19.5,165.05,35.7,165.05,60.95,165.05,90.6,165.05,123.6,163.05,166.85,159.1,202.8,156.25,225.5],"uvs":[-0.00025,1,0.0875,0.80243,0.20882,0.59976,0.32843,0.41578,0.4875,0.22015,0.61838,0.09757,0.74044,0.01481,0.82549,0,0.94044,0,1.00025,0.07864,1.00025,0.20121,1.00025,0.34515,1.00025,0.50534,0.99044,0.71529,0.97108,0.88981,0.95711,1],"triangles":[8,7,9,3,13,12,4,3,12,9,7,10,7,6,10,6,5,10,4,12,11,5,4,11,10,5,11,2,14,13,3,2,13,2,15,14,2,1,15,1,0,15],"weights":[1,3,1,3,3,0.574848,4,0.323383,8,0.101769,3,3,0.437289,4,0.432522,8,0.130188,3,3,0.298843,4,0.433312,8,0.267845,3,3,0.097233,8,0.455049,4,0.447718,3,3,0.061445,8,0.636053,4,0.302503,3,3,0.033267,8,0.837271,4,0.129462,3,3,0.01198,8,0.945488,4,0.042532,3,3,0.001227,8,0.994944,4,0.003829,3,3,0.013952,8,0.942456,4,0.043593,3,3,0.046417,8,0.795575,4,0.158009,3,3,0.100212,8,0.578315,4,0.321473,3,3,0.178287,8,0.427855,4,0.393858,3,3,0.296228,4,0.367013,8,0.336759,3,3,0.35922,4,0.364334,8,0.276446,1,3,1],"slotPose":[1,0,0,1,0,0],"bonePose":[3,0.406073,-0.913841,0.913841,0.406073,28.05,225,4,0.488867,-0.872358,0.872358,0.488867,56.8,160.3,8,0.614017,-0.789292,0.789292,0.614017,93.45,94.9],"edges":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,0],"userEdges":[]}]}]}],"animation":[{"duration":90,"playTimes":0,"name":"normal","bone":[{"name":"11","rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":45,"tweenEasing":0,"rotate":5.87},{"duration":0}]},{"name":"12","rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":45,"tweenEasing":0,"rotate":16.31},{"duration":0}]},{"name":"2","rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":45,"tweenEasing":0,"rotate":5.11},{"duration":0}]},{"name":"21","rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":45,"tweenEasing":0,"rotate":12.18},{"duration":0}]},{"name":"31","rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":45,"tweenEasing":0,"rotate":11.37},{"duration":0}]},{"name":"32","rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":45,"tweenEasing":0,"rotate":18.86},{"duration":0}]}]}],"defaultActions":[{"gotoAndPlay":"normal"}],"canvas":{"width":484,"height":449}}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "fc3e8c4a-9ec6-4e4d-a9f5-5ff5e0cdf883",
"subMetas": {}
}
\ No newline at end of file
{"width":512,"SubTexture":[{"width":138,"y":1,"height":399,"name":"DG24_leaves_left/3","x":1},{"width":218,"y":1,"height":249,"name":"DG24_leaves_left/2","x":141},{"width":204,"y":252,"height":206,"name":"DG24_leaves_left/1","x":141}],"height":512,"name":"DG24_leaves_left","imagePath":"DG24_leaves_left_tex.png"}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "5f29135c-ddbc-4028-8044-9eb57dd2c9d5",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "cae95502-937b-47c0-b9b7-ade18ca754a4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 512,
"platformSettings": {},
"subMetas": {
"DG24_leaves_left_tex": {
"ver": "1.0.4",
"uuid": "a0f3a006-4a97-4496-a151-4b1440b143f3",
"rawTextureUuid": "cae95502-937b-47c0-b9b7-ade18ca754a4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -76,
"offsetY": 26.5,
"trimX": 1,
"trimY": 1,
"width": 358,
"height": 457,
"rawWidth": 512,
"rawHeight": 512,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "fd8c1b7e-cef6-4da0-8fb1-ec8051a612be",
"subMetas": {}
}
\ No newline at end of file
{"width":1024,"SubTexture":[{"width":155,"y":1,"height":442,"name":"DG24_leaves_right(1)/leaf1","x":281},{"width":184,"y":260,"height":289,"name":"DG24_leaves_right(1)/leaf2","x":1},{"width":187,"y":551,"height":274,"name":"DG24_leaves_right(1)/leaf3","x":1},{"width":278,"y":1,"height":257,"name":"DG24_leaves_right(1)/leaf4","x":1},{"width":176,"y":445,"height":270,"name":"DG24_leaves_right(1)/leaf5","x":190},{"width":67,"y":445,"height":330,"name":"DG24_leaves_right(1)/flower1","x":368},{"width":60,"y":717,"height":261,"name":"DG24_leaves_right(1)/flower2","x":190}],"height":1024,"name":"DG24_leaves_right","imagePath":"DG24_leaves_right_tex.png"}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "06e38352-9833-4ed0-9d4f-3551847227ab",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2f596d35-c03f-49da-bcb8-2e227cd722a7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1024,
"height": 1024,
"platformSettings": {},
"subMetas": {
"DG24_leaves_right_tex": {
"ver": "1.0.4",
"uuid": "67bef703-a290-44ae-bf4f-07c7674f6bd1",
"rawTextureUuid": "2f596d35-c03f-49da-bcb8-2e227cd722a7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -293.5,
"offsetY": 22.5,
"trimX": 1,
"trimY": 1,
"width": 435,
"height": 977,
"rawWidth": 1024,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{"frameRate":24,"name":"DG25_cloud","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"Armature","aabb":{"x":-878.62,"y":-689.1,"width":1710.17,"height":610.93},"bone":[{"name":"root"},{"name":"bone","parent":"root","transform":{"x":-657.8951,"y":-295.7758}},{"name":"bone2","parent":"root","transform":{"x":610.7385,"y":-181.0596}},{"name":"bone3","parent":"root","transform":{"x":37.8334,"y":-564.6629}}],"slot":[{"name":"cloud","parent":"bone"},{"name":"cloud1","parent":"bone2"},{"name":"cloud11","parent":"bone3"}],"skin":[{"slot":[{"name":"cloud","display":[{"name":"cloud","transform":{"x":-2.72,"y":-12.06}}]},{"name":"cloud1","display":[{"name":"cloud","transform":{"x":2.82,"y":-16.12}}]},{"name":"cloud11","display":[{"name":"cloud","transform":{"x":0.92,"y":-5.44}}]}]}],"animation":[{"duration":1606,"playTimes":0,"name":"newAnimation","bone":[{"name":"bone","translateFrame":[{"duration":830,"tweenEasing":0},{"duration":776,"tweenEasing":0,"x":1948.28},{"duration":0}]},{"name":"bone2","translateFrame":[{"duration":930,"tweenEasing":0},{"duration":676,"tweenEasing":0,"x":-1861.94},{"duration":0}]},{"name":"bone3","translateFrame":[{"duration":752,"tweenEasing":0},{"duration":854,"tweenEasing":0,"x":-1089.06},{"duration":0,"x":975.42}]}]}],"defaultActions":[{"gotoAndPlay":"newAnimation"}],"canvas":{"width":1920,"height":1080}}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "49acdd98-1617-4147-8b6b-53f4a86835c5",
"subMetas": {}
}
\ No newline at end of file
{"name":"DG25_cloud","SubTexture":[{"name":"cloud","x":1,"height":237,"frameWidth":436,"y":1,"frameY":-1,"frameHeight":238,"frameX":-1,"width":434}],"imagePath":"DG25_cloud_tex.png","height":256,"width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "f5904208-e23c-44ff-ba28-a0ab7e551af8",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "332f5b3c-58b1-4b12-b367-677858cdc8c5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 256,
"platformSettings": {},
"subMetas": {
"DG25_cloud_tex": {
"ver": "1.0.4",
"uuid": "c523f0e3-20cb-4ad8-9ad3-c6b510285de6",
"rawTextureUuid": "332f5b3c-58b1-4b12-b367-677858cdc8c5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -38,
"offsetY": 8.5,
"trimX": 1,
"trimY": 1,
"width": 434,
"height": 237,
"rawWidth": 512,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "3508c369-60f6-4b88-a004-bb802d3abf4e",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "fbb941aa-f19a-4436-a6ca-fc6669360eea",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "2.3.5",
"uuid": "61a2033b-780d-4880-8d54-9e23a16c1a58",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 2048,
"platformSettings": {},
"subMetas": {
"boy_tex": {
"ver": "1.0.4",
"uuid": "3bda4b02-3b3b-49a1-995b-c78187b50217",
"rawTextureUuid": "61a2033b-780d-4880-8d54-9e23a16c1a58",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 172,
"trimX": 1,
"trimY": 1,
"width": 2045,
"height": 1702,
"rawWidth": 2048,
"rawHeight": 2048,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "f539c50b-908d-4d3d-a35b-d314c159be88",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "boy",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 5
}
],
"_prefab": {
"__id__": 6
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 715,
"height": 943
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0.5,
0.5,
0.5
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "aniNode",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 715,
"height": 943
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
503,
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": ""
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "3508c369-60f6-4b88-a004-bb802d3abf4e#fbb941aa-f19a-4436-a6ca-fc6669360eea",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "3508c369-60f6-4b88-a004-bb802d3abf4e"
},
"_N$dragonAtlasAsset": {
"__uuid__": "fbb941aa-f19a-4436-a6ca-fc6669360eea"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 9,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "e2c60f31-0e99-4c0d-bf7c-6355dae2c724"
},
"fileId": "27gh7VpBtEULSudnmmLQrx",
"sync": false
},
{
"__type__": "d2a28YQh/VMzIfxzeSB7pD4",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"aniBody": {
"__id__": 2
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "e2c60f31-0e99-4c0d-bf7c-6355dae2c724"
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "e2c60f31-0e99-4c0d-bf7c-6355dae2c724",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
import { asyncDelay, onHomeworkFinish } from "../script/util_DG25";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_DG25";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
// this._imageResList.push({ url: this.data.pic_url });
// this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
// this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
}
async onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initListener();
}
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
}
initView() {
this.initBg();
}
initBg() {
const bgNode = cc.find('Canvas/bg');
bgNode.scale = this._mapScaleMax;
}
initListener() {
}
playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
}
}
import { defaultData } from "../script/defaultData"; import { defaultData } from "../script/defaultData_DG25";
export class MyCocosSceneComponent extends cc.Component { export class MyCocosSceneComponent extends cc.Component {
...@@ -105,17 +105,17 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -105,17 +105,17 @@ export class MyCocosSceneComponent extends cc.Component {
}); });
} }
log (str) { log(str) {
const node = cc.find('middleLayer'); const node = cc.find('middleLayer');
if(node){ if (node) {
node.getComponent('middleLayer').log(str); node.getComponent('middleLayer').log(str);
}else{ } else {
console.log(str); console.log(str);
} }
} }
async onLoadEnd() { async onLoadEnd() {
} }
...@@ -132,7 +132,7 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -132,7 +132,7 @@ export class MyCocosSceneComponent extends cc.Component {
// ------------------------------------------------ // ------------------------------------------------
getSprNode(resName) { getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame; const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
...@@ -172,7 +172,7 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -172,7 +172,7 @@ export class MyCocosSceneComponent extends cc.Component {
}); });
} }
}); });
}else{ } else {
cb && cb(); cb && cb();
} }
} }
......
{
"ver": "1.1.2",
"uuid": "d8ae5e29-ddf5-4fdd-a7e5-c1abb787e633",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import { asyncPlayDragonBoneAnimation } from "../util_DG25";
const { ccclass, property } = cc._decorator;
@ccclass
export default class Boy extends cc.Component {
@property(cc.Node)
aniBody: cc.Node
aniNameList = ["run", "good", "cheer", "expect", "talk", "invite", "wave", "point"]
protected onLoad(): void {
// let index = 0;
// this.schedule(() => {
// index = index % this.aniNameList.length;
// asyncPlayDragonBoneAnimation(this.aniBody, this.aniNameList[index], 1);
// cc.log("play ani name :" + this.aniNameList[index]);
// index++;
// }, 3, 10000, 5)
// this.aniBody.getComponent(dragonBones.ArmatureDisplay)
}
playNormal() {
cc.log("play ani name : expect");
asyncPlayDragonBoneAnimation(this.aniBody, "normal", -1,)
}
async playRun(time: number = 1) {
cc.log("play ani name : run");
await asyncPlayDragonBoneAnimation(this.aniBody, "run", time);
this.playNormal();
}
async playCheer(time: number = 1) {
let localTime = time;
cc.log("play ani name : cheer");
await asyncPlayDragonBoneAnimation(this.aniBody, "cheer", time);
this.playNormal();
}
async playExpect(time: number = 1) {
let localTime = time;
cc.log("play ani name : expect");
await asyncPlayDragonBoneAnimation(this.aniBody, "expect", time);
this.playNormal();
}
async playtalk(time: number = 1) {
let localTime = time;
cc.log("play ani name : talk");
await asyncPlayDragonBoneAnimation(this.aniBody, "talk", time,)
this.playNormal();
}
async playGood(time: number = 1) {
let localTime = time;
cc.log("play ani name : good");
await asyncPlayDragonBoneAnimation(this.aniBody, "good", time)
this.playNormal();
}
async playWave(time: number = 1) {
let localTime = time;
cc.log("play ani name : wave");
await asyncPlayDragonBoneAnimation(this.aniBody, "wave", time)
this.playNormal();
}
async playPoint(time: number = 1) {
let localTime = time;
cc.log("play ani name : point");
await asyncPlayDragonBoneAnimation(this.aniBody, "point", time)
this.playNormal();
}
async playInvite(time: number = 1) {
let localTime = time;
cc.log("play ani name : invite");
await asyncPlayDragonBoneAnimation(this.aniBody, "invite", time)
this.playNormal();
}
// update (dt) {}
}
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "ade7af40-d56d-4087-bbc6-2888fef55353", "uuid": "d2a28610-87f5-4ccc-87f1-cde481ee90f8",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,
......
export enum gameState {
}
export function getPosByAngle(angle, len) { export function getPosByAngle(angle, len) {
const radian = angle * Math.PI / 180; const radian = angle * Math.PI / 180;
...@@ -71,64 +81,64 @@ export function setSprNodeMaxLen(sprNode, maxW, maxH) { ...@@ -71,64 +81,64 @@ export function setSprNodeMaxLen(sprNode, maxW, maxH) {
} }
export function localPosTolocalPos(baseNode, targetNode) { export function localPosTolocalPos(baseNode, targetNode) {
const worldPos = targetNode.parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y)); const worldPos = targetNode.parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y));
const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y)); const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
return localPos; return localPos;
} }
export function worldPosToLocalPos(worldPos, baseNode) { export function worldPosToLocalPos(worldPos, baseNode) {
const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y)); const localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
return localPos; return localPos;
} }
export function getScaleRateBy2Node(baseNode, targetNode, maxFlag = true) { export function getScaleRateBy2Node(baseNode, targetNode, maxFlag = true) {
const worldRect1 = targetNode.getBoundingBoxToWorld(); const worldRect1 = targetNode.getBoundingBoxToWorld();
const worldRect2 = baseNode.getBoundingBoxToWorld(); const worldRect2 = baseNode.getBoundingBoxToWorld();
const sx = worldRect1.width / worldRect2.width; const sx = worldRect1.width / worldRect2.width;
const sy = worldRect1.height / worldRect2.height; const sy = worldRect1.height / worldRect2.height;
if (maxFlag) { if (maxFlag) {
return Math.max(sx, sy); return Math.max(sx, sy);
} else { } else {
return Math.min(sx, sy); return Math.min(sx, sy);
} }
} }
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: any) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8); const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) { if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => { cc.audioEngine.setFinishCallback(audioId, () => {
cb(); cb();
}); });
} }
}); });
} }
} }
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()
}) })
} }
...@@ -177,83 +187,17 @@ export function playAudio(audioClip, cb = null) { ...@@ -177,83 +187,17 @@ export function playAudio(audioClip, cb = null) {
export async function asyncDelay(time) { export async function asyncDelay(time) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
cc.tween(cc.find('Canvas')) const canvas = cc.find('Canvas');
cc.tween(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 } }) {
if (!texPngDataUrl || !texJsonDataUrl || !texPngDataUrl
|| texPngDataUrl == '' || texJsonDataUrl == '' || texPngDataUrl == '') {
return;
}
return new Promise((resolve, reject) => {
if (node.animaNode) {
node.animaNode.removeFromParent();
}
const animaNode = new cc.Node();
animaNode.name = 'animaNode';
animaNode.parent = node;
animaNode.active = true;
node.animaNode = animaNode;
const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
const loadTexture = new Promise((resolve, reject) => {
cc.assetManager.loadRemote(texPngDataUrl, (error, texture) => {
if (error) {
reject(error);
}
resolve(texture);
});
});
const loadTexJsonData = new Promise((resolve, reject) => {
cc.assetManager.loadAny({ url: texJsonDataUrl }, (error, atlasJson) => {
if (error) {
reject(error);
}
resolve(atlasJson);
});
});
const loadSkeJsonData = new Promise((resolve, reject) => {
cc.assetManager.loadAny({ url: skeJsonDataUrl }, (error, dragonBonesJson) => {
if (error) {
reject(error);
}
resolve(dragonBonesJson);
});
});
Promise.all([loadTexture, loadTexJsonData, loadSkeJsonData]).then(([texture, atlasJson, dragonBonesJson]) => {
const atlas = new dragonBones.DragonBonesAtlasAsset();
atlas.atlasJson = JSON.stringify(atlasJson);
atlas.texture = texture;
const asset = new dragonBones.DragonBonesAsset();
asset.dragonBonesJson = JSON.stringify(dragonBonesJson);
dragonDisplay.dragonAtlasAsset = atlas;
dragonDisplay.dragonAsset = asset;
let armatureNames = dragonBonesJson.armature.map(data => data.name);
if (armatureNames.length > 0) {
dragonDisplay.armatureName = armatureNames[0];
}
resolve(animaNode);
});
});
} }
export class FireworkSettings { export class FireworkSettings {
...@@ -411,65 +355,64 @@ export function showTrebleFirework(baseNode, rabbonList) { ...@@ -411,65 +355,64 @@ export function showTrebleFirework(baseNode, rabbonList) {
showFireworks(right); showFireworks(right);
} }
export function httpHeadCall(requsetUrl: string, callback) { export function onHomeworkFinish(data: any = null) {
let xhr = new XMLHttpRequest();
console.log("Status: Send Post Request to " + requsetUrl);
try {
xhr.onreadystatechange = () => {
try {
console.log('xhr.readyState: ', xhr.readyState);
if (xhr.readyState == 4) {
if ((xhr.status >= 200 && xhr.status < 400)) {
callback(true);
} else {
callback(false);
}
}
} catch (e) {
console.log(e)
}
};
xhr.open("HEAD", requsetUrl, true);
xhr.send();
xhr.timeout = 15000;
xhr.onerror = (e) => {
callback(false);
};
xhr.ontimeout = (e) => {
callback(false);
};
} catch (e) {
console.log("Send Get Request error: ", e);
}
}
export function onHomeworkFinish(data = "", callback = ()=>{}) {
const middleLayer = cc.find('middleLayer'); const middleLayer = cc.find('middleLayer');
if (middleLayer) { if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer'); const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.onHomeworkFinish(callback, data); if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { }, data);
}
} else { } else {
console.log('onHomeworkFinish', JSON.stringify(data)); console.log('onHomeworkFinish');
} }
} }
export function callMiddleLayerFunction(apiName: string, data: any, callback: Function) { export async function asyncPlayDragonBoneAnimation(node, animationName, time = 1, onFrameEvent = null) {
const middleLayer = cc.find('middleLayer'); return new Promise((resolve, reject) => {
if (middleLayer) { node.getComponent(dragonBones.ArmatureDisplay)
const middleLayerComponent = middleLayer.getComponent('middleLayer'); .once(dragonBones.EventObject.COMPLETE, () => {
middleLayerComponent.callMiddleLayerFunction(apiName, data, callback);
cc.log("once end:-----")
resolve(null);
});
node.getComponent(dragonBones.ArmatureDisplay)
.on(dragonBones.EventObject.FRAME_EVENT, ({ name }) => {
if (onFrameEvent && typeof (onFrameEvent) == 'function') {
cc.log("onFrameEvent:" + name)
onFrameEvent(name);
}
});
node.getComponent(dragonBones.ArmatureDisplay)
.playAnimation(animationName, time);
});
}
export function getLv(num) {
if (num < 1000) {
return 0;
} else if (num < 5000) {
return 1;
} else if (num < 20000) {
return 2;
} else { } else {
console.log('callMiddleLayerFunction: ' + apiName); return 3;
} }
} }
export function showTips(tips) { export function getMinLv(num) {
const middleLayer = cc.find('middleLayer');
if (middleLayer) { if (num < 1000) {
middleLayer.getComponent('middleLayer').showTips(tips); return Math.floor(num / 200);
} else if (num < 5000) {
return Math.floor((num - 1000) / 800);;
} else if (num < 20000) {
return Math.floor((num - 5000) / 3000);;
} else { } else {
console.log(tips); return Math.floor((num - 20000) / 6000);;
} }
} }
{
"ver": "1.0.8",
"uuid": "f185cdcc-39fc-43ca-86df-5fbd99c7a98e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "uuid": "43874324-d0c7-44be-b2e2-9470a6173739",
"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": 30,
"height": 67, "height": 1331,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_right": { "bg_sky_scale2adjust": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59", "uuid": "57cdfaa8-c406-4e38-b722-d56815d29fa7",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71", "rawTextureUuid": "43874324-d0c7-44be-b2e2-9470a6173739",
"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": 30,
"height": 66, "height": 1331,
"rawWidth": 61, "rawWidth": 30,
"rawHeight": 67, "rawHeight": 1331,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "uuid": "574e4941-6c01-457e-b7e6-8c63b375637a",
"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": 436,
"height": 336, "height": 238,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"1orange": { "cloud": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa", "uuid": "ba76d36a-f298-4d0a-96a0-841bb785b6e7",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f", "rawTextureUuid": "574e4941-6c01-457e-b7e6-8c63b375637a",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": 0,
"offsetY": -0.5, "offsetY": -0.5,
"trimX": 0, "trimX": 1,
"trimY": 1, "trimY": 1,
"width": 366, "width": 434,
"height": 335, "height": 237,
"rawWidth": 366, "rawWidth": 436,
"rawHeight": 336, "rawHeight": 238,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b", "uuid": "e0284829-5e05-460e-a81a-9a8db5eb7945",
"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": 1280, "width": 1348,
"height": 720, "height": 1051,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg": { "img_board": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd", "uuid": "df072013-29d2-49cb-95f8-233ee1775287",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b", "rawTextureUuid": "e0284829-5e05-460e-a81a-9a8db5eb7945",
"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": 1280, "width": 1348,
"height": 720, "height": 1051,
"rawWidth": 1280, "rawWidth": 1348,
"rawHeight": 720, "rawHeight": 1051,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "23fb4636-3b17-4b53-a4d4-10e63c239e19",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1920,
"height": 740,
"platformSettings": {},
"subMetas": {
"img_groundandmountain": {
"ver": "1.0.4",
"uuid": "230331c8-1748-47a1-97a1-5640c009d4a2",
"rawTextureUuid": "23fb4636-3b17-4b53-a4d4-10e63c239e19",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1920,
"height": 740,
"rawWidth": 1920,
"rawHeight": 740,
"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": "a45fa219-3090-4f0d-ba1c-a0cb5f9093a8",
"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": 489,
"height": 67, "height": 120,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_left": { "img_stone_4xiaodi": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5", "uuid": "d3c8433a-a4b7-4e9c-972d-eb205af0351f",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027", "rawTextureUuid": "a45fa219-3090-4f0d-ba1c-a0cb5f9093a8",
"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": 489,
"height": 67, "height": 120,
"rawWidth": 61, "rawWidth": 489,
"rawHeight": 67, "rawHeight": 120,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
import { asyncDelay, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
}
addPreloadAnima() {
}
async onLoadEnd() {
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this.initData();
this.initView();
this.initListener();
}
_cantouch = null;
initData() {
// 所有全局变量 默认都是null
this._cantouch = true;
}
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();
this.playLocalAudio('btn');
})
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();
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish();
this.playLocalAudio('btn');
})
}
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) {},
initListener() {
}
playLocalAudio(audioName) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
}
}
{
"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
...@@ -4,5 +4,6 @@ ...@@ -4,5 +4,6 @@
"name": "play", "name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231", "id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.5", "version": "2.4.5",
"isNew": false "isNew": false,
"description": ""
} }
\ No newline at end of file
...@@ -2,5 +2,39 @@ ...@@ -2,5 +2,39 @@
"last-module-event-record-time": 1600677246969, "last-module-event-record-time": 1600677246969,
"migrate-history": [ "migrate-history": [
"cloud-function" "cloud-function"
] ],
"group-list": [
"default"
],
"collision-matrix": [
[
true
]
],
"excluded-modules": [
"3D Physics/Builtin"
],
"preview-port": 7456,
"design-resolution-width": 1960,
"design-resolution-height": 1080,
"fit-width": true,
"fit-height": true,
"use-project-simulator-setting": false,
"simulator-orientation": false,
"use-customize-simulator": true,
"simulator-resolution": {
"width": 960,
"height": 640
},
"clear-simulator-cache": true,
"facebook": {
"enable": false,
"appID": "",
"live": {
"enable": false
},
"audience": {
"enable": false
}
}
} }
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