diff --git a/JMKA - 捷徑.lnk b/JMKA - 捷徑.lnk new file mode 100644 index 0000000..4ddeadc Binary files /dev/null and b/JMKA - 捷徑.lnk differ diff --git a/assets/Prefab.meta b/assets/Prefab.meta new file mode 100644 index 0000000..8f066d5 --- /dev/null +++ b/assets/Prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.3", + "uuid": "a0181a7b-9c3d-4126-a012-acf5a1e095a2", + "importer": "folder", + "isBundle": false, + "bundleName": "", + "priority": 1, + "compressionType": {}, + "optimizeHotUpdate": {}, + "inlineSpriteFrames": {}, + "isRemoteBundle": {}, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Prefab/UpdatePanel.prefab b/assets/Prefab/UpdatePanel.prefab new file mode 100644 index 0000000..b3d7cc8 --- /dev/null +++ b/assets/Prefab/UpdatePanel.prefab @@ -0,0 +1,3027 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "", + "_objFlags": 0, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "asyncLoadAssets": false, + "readonly": false + }, + { + "__type__": "cc.Node", + "_name": "UpdatePanel", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + }, + { + "__id__": 7 + } + ], + "_active": false, + "_components": [ + { + "__id__": 78 + } + ], + "_prefab": { + "__id__": 79 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 1920 + }, + "_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": "" + }, + { + "__type__": "cc.Node", + "_name": "background_mask", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 3 + }, + { + "__id__": 4 + }, + { + "__id__": 5 + } + ], + "_prefab": { + "__id__": 6 + }, + "_opacity": 207.315, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 1920 + }, + "_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": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "7d1d4e60-aba2-48e8-85f8-8e328f34e7cc" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 54, + "_originalHeight": 81, + "_id": "" + }, + { + "__type__": "cc.BlockInputEvents", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "70eAC2TBhG77Zid440sfQw", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "UpdatePanel", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 8 + }, + { + "__id__": 11 + }, + { + "__id__": 14 + }, + { + "__id__": 17 + }, + { + "__id__": 24 + }, + { + "__id__": 27 + }, + { + "__id__": 34 + }, + { + "__id__": 37 + }, + { + "__id__": 45 + }, + { + "__id__": 53 + }, + { + "__id__": 61 + }, + { + "__id__": 64 + }, + { + "__id__": 67 + } + ], + "_active": true, + "_components": [ + { + "__id__": 75 + }, + { + "__id__": 76 + } + ], + "_prefab": { + "__id__": 77 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 800, + "height": 600 + }, + "_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": "" + }, + { + "__type__": "cc.Node", + "_name": "close", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 9 + } + ], + "_prefab": { + "__id__": 10 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 33, + "height": 48 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -356, + 265, + 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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 8 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "6035fac6-5208-4e0b-bea7-62ff9fb1338b" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "95z/pNk5BFcIjDetW3Xmh/", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "update_title", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 12 + } + ], + "_prefab": { + "__id__": 13 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 267, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 11 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "热更新信息", + "_N$string": "热更新信息", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "10TPMZ225IWp0DIbRtmztD", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "label1", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 15 + } + ], + "_prefab": { + "__id__": 16 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -260, + 150, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 14 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "File", + "_N$string": "File", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "3dXBzhLuhD+rVsRXn7AeDB", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "fileProgress", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 18 + } + ], + "_active": true, + "_components": [ + { + "__id__": 21 + }, + { + "__id__": 22 + } + ], + "_prefab": { + "__id__": 23 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 80, + 150, + 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__": "cc.Node", + "_name": "bar", + "_objFlags": 0, + "_parent": { + "__id__": 17 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 19 + } + ], + "_prefab": { + "__id__": 20 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 35 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -250, + 1.8, + 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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 18 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "7d1d4e60-aba2-48e8-85f8-8e328f34e7cc" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "6ewSs911dHoJBK1lf0wAuy", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 17 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "022a80ab-4cde-42ca-9e04-8a23745cf138" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 17 + }, + "_enabled": true, + "_N$totalLength": 500, + "_N$barSprite": { + "__id__": 19 + }, + "_N$mode": 0, + "_N$progress": 0, + "_N$reverse": false, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "92bEc/axFEKKzjy8vGjzxM", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "label2", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 25 + } + ], + "_prefab": { + "__id__": 26 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -260, + 40, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 24 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "Byte", + "_N$string": "Byte", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "79WgZNqCtLjI1gVSXEOjX0", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "byteProgress", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 28 + } + ], + "_active": true, + "_components": [ + { + "__id__": 31 + }, + { + "__id__": 32 + } + ], + "_prefab": { + "__id__": 33 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 80, + 40, + 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__": "cc.Node", + "_name": "bar", + "_objFlags": 0, + "_parent": { + "__id__": 27 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 29 + } + ], + "_prefab": { + "__id__": 30 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 35 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -250, + 1.8, + 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__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 28 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "7d1d4e60-aba2-48e8-85f8-8e328f34e7cc" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "606FdJlO9Ka42ZO0jLg63R", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "022a80ab-4cde-42ca-9e04-8a23745cf138" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "_N$totalLength": 500, + "_N$barSprite": { + "__id__": 29 + }, + "_N$mode": 0, + "_N$progress": 0, + "_N$reverse": false, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "5fkUNH4BpIaqFx+pLNXaml", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "info", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 35 + } + ], + "_prefab": { + "__id__": 36 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 600, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -111, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 34 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "", + "_N$string": "", + "_fontSize": 22, + "_lineHeight": 26, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 0, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "c0giTbIY1MIJBR4pC1KSgO", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "check_btn", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 38 + } + ], + "_active": true, + "_components": [ + { + "__id__": 41 + }, + { + "__id__": 42 + }, + { + "__id__": 43 + } + ], + "_prefab": { + "__id__": 44 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 250, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -160, + -220, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0 + ] + }, + "_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": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 37 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 39 + } + ], + "_prefab": { + "__id__": 40 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 11, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 38 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "检查更新", + "_N$string": "检查更新", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "edxS3BFDdMzZY8wWCpR+XE", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 37 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 0, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 37 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 37 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 0.8, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 37 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "0cfnQnbnxDuKZuqJ5Lbv0t", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "update_btn", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 46 + } + ], + "_active": true, + "_components": [ + { + "__id__": 49 + }, + { + "__id__": 50 + }, + { + "__id__": 51 + } + ], + "_prefab": { + "__id__": 52 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 250, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 160, + -220, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0 + ] + }, + "_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": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 45 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 47 + } + ], + "_prefab": { + "__id__": 48 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 11, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 46 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "立即更新", + "_N$string": "立即更新", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "71Orp+ih5BHrQfZ3vJK0u9", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 45 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 0, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 45 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 45 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 0.8, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 45 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "c75HXFVy9B7pTqRUUPU3eA", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "retry_btn", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 54 + } + ], + "_active": false, + "_components": [ + { + "__id__": 57 + }, + { + "__id__": 58 + }, + { + "__id__": 59 + } + ], + "_prefab": { + "__id__": 60 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 250, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 160, + -220, + 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__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 53 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 55 + } + ], + "_prefab": { + "__id__": 56 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 11, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 54 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "重试更新", + "_N$string": "重试更新", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "730uHK8jlLd4txnAxcZb0g", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 53 + }, + "_enabled": true, + "alignMode": 1, + "_wasAlignOnce": {}, + "isAlignOnce": {}, + "_target": null, + "_alignFlags": 0, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 53 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 53 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 0.8, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 53 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "f30tLL6exEybyfUkbH3eb5", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "filep", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 62 + } + ], + "_prefab": { + "__id__": 63 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 94, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 61 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "/", + "_N$string": "/", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "5450pY1E9BkJmbBVh1AEJ0", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "bytep", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 65 + } + ], + "_prefab": { + "__id__": 66 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 300, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -20, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 64 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "/", + "_N$string": "/", + "_fontSize": 28, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "d0EB2kVz1JNIVfS9WJE2Lw", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "update_btn", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 68 + } + ], + "_active": false, + "_components": [ + { + "__id__": 71 + }, + { + "__id__": 72 + }, + { + "__id__": 73 + } + ], + "_prefab": { + "__id__": 74 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 60 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 260, + 266, + 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__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 67 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 69 + } + ], + "_prefab": { + "__id__": 70 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 4, + 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__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 68 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "使用自定义配置", + "_N$string": "使用自定义配置", + "_fontSize": 20, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "6dIuP6RVJLXJovx7BMU02v", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 67 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 0, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 67 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 67 + }, + "_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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 67 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "belRJCQgZG273uhmea0wfb", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 7 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "ca7dd73d-526a-4c85-9702-eb51e93b9d99" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "86711tHE/ZKToqdDiTn/Kbn", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 7 + }, + "_enabled": true, + "info": { + "__id__": 35 + }, + "fileProgress": { + "__id__": 22 + }, + "fileLabel": { + "__id__": 62 + }, + "byteProgress": { + "__id__": 32 + }, + "byteLabel": { + "__id__": 65 + }, + "close": { + "__id__": 8 + }, + "checkBtn": { + "__id__": 37 + }, + "retryBtn": { + "__id__": 53 + }, + "updateBtn": { + "__id__": 45 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "84wtdr8/dBoqjboCRy4not", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 9, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "", + "sync": false + } +] \ No newline at end of file diff --git a/assets/Prefab/UpdatePanel.prefab.meta b/assets/Prefab/UpdatePanel.prefab.meta new file mode 100644 index 0000000..7b00a3c --- /dev/null +++ b/assets/Prefab/UpdatePanel.prefab.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.3.2", + "uuid": "9d9ca13a-071d-47f4-836c-a69d1045dc14", + "importer": "prefab", + "optimizationPolicy": "AUTO", + "asyncLoadAssets": false, + "readonly": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Scene/Main.fire b/assets/Scene/Main.fire index dac7a36..b8f8f23 100644 --- a/assets/Scene/Main.fire +++ b/assets/Scene/Main.fire @@ -17,7 +17,7 @@ "__id__": 2 } ], - "_active": true, + "_active": false, "_components": [], "_prefab": null, "_opacity": 255, @@ -76,18 +76,21 @@ }, { "__id__": 8 + }, + { + "__id__": 10 } ], "_active": true, "_components": [ { - "__id__": 10 + "__id__": 89 }, { - "__id__": 11 + "__id__": 90 }, { - "__id__": 12 + "__id__": 91 } ], "_prefab": null, @@ -322,9 +325,7 @@ }, "_enabled": true, "alignMode": 1, - "_target": { - "__id__": 2 - }, + "_target": null, "_alignFlags": 45, "_left": 0, "_right": 0, @@ -436,6 +437,3021 @@ "_atlas": null, "_id": "d9uP1ksCZCaai71lia08yU" }, + { + "__type__": "cc.Node", + "_name": "UpdatePanel", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 11 + }, + { + "__id__": 16 + } + ], + "_active": false, + "_components": [ + { + "__id__": 87 + } + ], + "_prefab": { + "__id__": 88 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 1920 + }, + "_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": "40fjcW2WFOj5BFlUp2Da1e" + }, + { + "__type__": "cc.Node", + "_name": "background_mask", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 12 + }, + { + "__id__": 13 + }, + { + "__id__": 14 + } + ], + "_prefab": { + "__id__": 15 + }, + "_opacity": 207.315, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1080, + "height": 1920 + }, + "_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": "deVknj90RAu4sER32HC9Ik" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 11 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "7d1d4e60-aba2-48e8-85f8-8e328f34e7cc" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "a5QP5T3X1Jl7Uc22Nn3I/g" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 11 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 54, + "_originalHeight": 81, + "_id": "5aJ1aPWaBLEJWIGEZYgA0T" + }, + { + "__type__": "cc.BlockInputEvents", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 11 + }, + "_enabled": true, + "_id": "1dYaPTb8tCKoHCoFkeNwbA" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "70eAC2TBhG77Zid440sfQw", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "UpdatePanel", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [ + { + "__id__": 17 + }, + { + "__id__": 20 + }, + { + "__id__": 23 + }, + { + "__id__": 26 + }, + { + "__id__": 33 + }, + { + "__id__": 36 + }, + { + "__id__": 43 + }, + { + "__id__": 46 + }, + { + "__id__": 54 + }, + { + "__id__": 62 + }, + { + "__id__": 70 + }, + { + "__id__": 73 + }, + { + "__id__": 76 + } + ], + "_active": true, + "_components": [ + { + "__id__": 84 + }, + { + "__id__": 85 + } + ], + "_prefab": { + "__id__": 86 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 800, + "height": 600 + }, + "_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": "64FXGb5h5LJYSA76bvIEfw" + }, + { + "__type__": "cc.Node", + "_name": "close", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 18 + } + ], + "_prefab": { + "__id__": 19 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 33, + "height": 48 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -356, + 265, + 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": "72LqCnIKJOdaJv9IF5hc6b" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 17 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "6035fac6-5208-4e0b-bea7-62ff9fb1338b" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "1doAosBK5LXasv1bLHJuBm" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "95z/pNk5BFcIjDetW3Xmh/", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "update_title", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 21 + } + ], + "_prefab": { + "__id__": 22 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 267, + 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": "fdAb95M2tNqJKqeTnVFhpy" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 20 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "热更新信息", + "_N$string": "热更新信息", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "eeegQlqT5KB4D0iuqxaSgo" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "10TPMZ225IWp0DIbRtmztD", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "label1", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 24 + } + ], + "_prefab": { + "__id__": 25 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -260, + 150, + 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": "fecWSXN0NB8KCrCXqCqqZQ" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 23 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "File", + "_N$string": "File", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "87KY3bfBtGMKHqNh3n8Iie" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "3dXBzhLuhD+rVsRXn7AeDB", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "fileProgress", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [ + { + "__id__": 27 + } + ], + "_active": true, + "_components": [ + { + "__id__": 30 + }, + { + "__id__": 31 + } + ], + "_prefab": { + "__id__": 32 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 80, + 150, + 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": "874avuTGZMdoNGvtvkGTUg" + }, + { + "__type__": "cc.Node", + "_name": "bar", + "_objFlags": 0, + "_parent": { + "__id__": 26 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 28 + } + ], + "_prefab": { + "__id__": 29 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 35 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -250, + 1.8, + 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": "78lYmtW1NA+LsHtyfRRm1x" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "7d1d4e60-aba2-48e8-85f8-8e328f34e7cc" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "1dYw8JUaBKeJMwvuphmdx2" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "6ewSs911dHoJBK1lf0wAuy", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 26 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "022a80ab-4cde-42ca-9e04-8a23745cf138" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "f3PZg/fRVLwZ1Siji3QOhe" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 26 + }, + "_enabled": true, + "_N$totalLength": 500, + "_N$barSprite": { + "__id__": 28 + }, + "_N$mode": 0, + "_N$progress": 0, + "_N$reverse": false, + "_id": "0bWOc4EapPOqt5c5YR9dWP" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "92bEc/axFEKKzjy8vGjzxM", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "label2", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 34 + } + ], + "_prefab": { + "__id__": 35 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -260, + 40, + 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": "78NjAtPyRNI6WS3RDJkkB5" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 33 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "Byte", + "_N$string": "Byte", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "c1TpFTPbhPG49Ei52LPrPR" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "79WgZNqCtLjI1gVSXEOjX0", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "byteProgress", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [ + { + "__id__": 37 + } + ], + "_active": true, + "_components": [ + { + "__id__": 40 + }, + { + "__id__": 41 + } + ], + "_prefab": { + "__id__": 42 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 500, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 80, + 40, + 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": "70dwuj9L9F/43S4G2i/dWE" + }, + { + "__type__": "cc.Node", + "_name": "bar", + "_objFlags": 0, + "_parent": { + "__id__": 36 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 38 + } + ], + "_prefab": { + "__id__": 39 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 35 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -250, + 1.8, + 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": "292QnsVTBEzbJi9DEqi8TE" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 37 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "7d1d4e60-aba2-48e8-85f8-8e328f34e7cc" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "eeScIZVm1BNJE2wpSv/JaF" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "606FdJlO9Ka42ZO0jLg63R", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 36 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "022a80ab-4cde-42ca-9e04-8a23745cf138" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "45X9U/zclOg6JFMnQSF+HQ" + }, + { + "__type__": "cc.ProgressBar", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 36 + }, + "_enabled": true, + "_N$totalLength": 500, + "_N$barSprite": { + "__id__": 38 + }, + "_N$mode": 0, + "_N$progress": 0, + "_N$reverse": false, + "_id": "c7QbxZHV9OOIbAbLM0/ozs" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "5fkUNH4BpIaqFx+pLNXaml", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "info", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 44 + } + ], + "_prefab": { + "__id__": 45 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 600, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -111, + 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": "d9yO/MVzVN8rPR5mZkXmNM" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 43 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "", + "_N$string": "", + "_fontSize": 22, + "_lineHeight": 26, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 0, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "12p1X0HpBJDohSbDpfPq/J" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "c0giTbIY1MIJBR4pC1KSgO", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "check_btn", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [ + { + "__id__": 47 + } + ], + "_active": true, + "_components": [ + { + "__id__": 50 + }, + { + "__id__": 51 + }, + { + "__id__": 52 + } + ], + "_prefab": { + "__id__": 53 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 250, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -160, + -220, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "23XSylaURGHK32E2zYZud2" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 46 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 48 + } + ], + "_prefab": { + "__id__": 49 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 11, + 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": "ac82HCWnNILYt8N+ty1Ulg" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 47 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "检查更新", + "_N$string": "检查更新", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "62jiYwlj9MCK8c1tGlcka5" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "edxS3BFDdMzZY8wWCpR+XE", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 46 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 0, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "88tC7Bd9RMAYgjGiE4OxQO" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 46 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "f4JTvkD+ZIMY35VJcUFvWt" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 46 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 0.8, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 46 + }, + "_id": "bcDHLqpsNFjJUWvP050NtF" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "0cfnQnbnxDuKZuqJ5Lbv0t", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "update_btn", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [ + { + "__id__": 55 + } + ], + "_active": true, + "_components": [ + { + "__id__": 58 + }, + { + "__id__": 59 + }, + { + "__id__": 60 + } + ], + "_prefab": { + "__id__": 61 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 250, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 160, + -220, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 0 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "05PhqPPg9O64eJgqAXTEh9" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 54 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 56 + } + ], + "_prefab": { + "__id__": 57 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 11, + 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": "07BCBeUbhAj5GeDty8FRI1" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 55 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "立即更新", + "_N$string": "立即更新", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "c9tlunNn5PGp9f0Vwb58dM" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "71Orp+ih5BHrQfZ3vJK0u9", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 54 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 0, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "dftDaIDDlGno8RLRsBDn4N" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 54 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "fc59NXZUxHZKVWjaI093bc" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 54 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 0.8, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 54 + }, + "_id": "966/PPPZ1A8JJhn0XlM7dc" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "c75HXFVy9B7pTqRUUPU3eA", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "retry_btn", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [ + { + "__id__": 63 + } + ], + "_active": false, + "_components": [ + { + "__id__": 66 + }, + { + "__id__": 67 + }, + { + "__id__": 68 + } + ], + "_prefab": { + "__id__": 69 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 250, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 160, + -220, + 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": "19YLA0tnFKj4XlgeCoJlu6" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 62 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 64 + } + ], + "_prefab": { + "__id__": 65 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 11, + 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": "22HBUcWfRG7IPjNlIWa/Lt" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 63 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "重试更新", + "_N$string": "重试更新", + "_fontSize": 30, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "b1vyFi8ahIrL++NxLU4NCZ" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "730uHK8jlLd4txnAxcZb0g", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 62 + }, + "_enabled": true, + "alignMode": 1, + "_wasAlignOnce": {}, + "isAlignOnce": {}, + "_target": null, + "_alignFlags": 0, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "dbjJmYT/tLHYtUZ4YuPgvy" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 62 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "c5GHcgPU5MSZmrpXFEPZMv" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 62 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 0.8, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 62 + }, + "_id": "1cdGS9O5pOcbq2g+uxp1VX" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "f30tLL6exEybyfUkbH3eb5", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "filep", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 71 + } + ], + "_prefab": { + "__id__": 72 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 150, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 94, + 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": "bfgVdFcydLAaCDssh/mvYF" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 70 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "/", + "_N$string": "/", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "eceJbggI1KxqqkKtPR1V/u" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "5450pY1E9BkJmbBVh1AEJ0", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "bytep", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 74 + } + ], + "_prefab": { + "__id__": 75 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 300, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -20, + 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": "c1M2yPppROlae60c1u886u" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 73 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "/", + "_N$string": "/", + "_fontSize": 28, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "f3+R3UhVVAWY0StYE4LSDv" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "d0EB2kVz1JNIVfS9WJE2Lw", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "update_btn", + "_objFlags": 0, + "_parent": { + "__id__": 16 + }, + "_children": [ + { + "__id__": 77 + } + ], + "_active": false, + "_components": [ + { + "__id__": 80 + }, + { + "__id__": 81 + }, + { + "__id__": 82 + } + ], + "_prefab": { + "__id__": 83 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 60 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 260, + 266, + 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": "aaa6aEwLNEypywq9+1uRLT" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 76 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 78 + } + ], + "_prefab": { + "__id__": 79 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + 4, + 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": "9cpKQ6XmBB6Jjn514RJgEF" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 77 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "使用自定义配置", + "_N$string": "使用自定义配置", + "_fontSize": 20, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "0a4sB05RdMz55xfzw3G7kb" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "6dIuP6RVJLXJovx7BMU02v", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 76 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 0, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "c4wWoTd2tHa7C61JxW7pQm" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 76 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "f1K5mPrBFBAZ9mcQXW6w3j" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 76 + }, + "_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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "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": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$normalSprite": { + "__uuid__": "c01466ea-7283-4fce-b615-4ee78c774af0" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "hoverSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 76 + }, + "_id": "e9E2QuFXlGjrUXqxtzG49G" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "belRJCQgZG273uhmea0wfb", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 16 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "ca7dd73d-526a-4c85-9702-eb51e93b9d99" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "8aZKLYrhVOSbNb651gNGyC" + }, + { + "__type__": "86711tHE/ZKToqdDiTn/Kbn", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 16 + }, + "_enabled": true, + "info": { + "__id__": 44 + }, + "fileProgress": { + "__id__": 31 + }, + "fileLabel": { + "__id__": 71 + }, + "byteProgress": { + "__id__": 41 + }, + "byteLabel": { + "__id__": 74 + }, + "close": { + "__id__": 17 + }, + "checkBtn": { + "__id__": 46 + }, + "retryBtn": { + "__id__": 62 + }, + "updateBtn": { + "__id__": 54 + }, + "_id": "464T+AWcJLnIIROL7trTEC" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "84wtdr8/dBoqjboCRy4not", + "sync": false + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 10 + }, + "_enabled": true, + "alignMode": 1, + "_target": null, + "_alignFlags": 9, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_id": "61PygungNH4Iusse4dVSZC" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 10 + }, + "asset": { + "__uuid__": "9d9ca13a-071d-47f4-836c-a69d1045dc14" + }, + "fileId": "", + "sync": false + }, { "__type__": "cc.Canvas", "_name": "", @@ -494,6 +3510,9 @@ "BG": { "__id__": 8 }, + "UpdatePanel": { + "__id__": 10 + }, "_id": "b3AScs1lVP7ruEGNmMEKXU" } ] \ No newline at end of file diff --git a/assets/Script/HUD.meta b/assets/Script/HUD.meta new file mode 100644 index 0000000..2842afd --- /dev/null +++ b/assets/Script/HUD.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.3", + "uuid": "b4db1c37-7356-4f88-ba5c-9ea4e86a85b7", + "importer": "folder", + "isBundle": false, + "bundleName": "", + "priority": 1, + "compressionType": {}, + "optimizeHotUpdate": {}, + "inlineSpriteFrames": {}, + "isRemoteBundle": {}, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/HUD/AssetBundleMamager.ts b/assets/Script/HUD/AssetBundleMamager.ts new file mode 100644 index 0000000..7a83dff --- /dev/null +++ b/assets/Script/HUD/AssetBundleMamager.ts @@ -0,0 +1,456 @@ +// import BusinessTypeSetting from "../../_BusinessTypeSetting/BusinessTypeSetting"; +// import LocalStorageData from "../Data/LocalStorageData"; +// import Enum_Loading from "../HUDV2/Enum_Loading"; +// import HUDM from "./HUDM"; + +// export default class AssetBundleMamager { +// //#region static 屬性 + +// private static _instance: AssetBundleMamager = null; +// public static get Instance(): AssetBundleMamager { return AssetBundleMamager._instance; } + +// //#endregion + +// //#region public 屬性 + +// public HUGroup: Map = new Map(); + +// /** 本地VerList */ +// public LocalVerList: Enum_Loading.VerListObj = null; + +// /** 遠端VerList */ +// public RemoteVerList: Enum_Loading.VerListObj = null; + +// public DownloadList_Preview: Object = {}; + +// /** IsChangeBundleUrl */ +// public IsChangeBundleUrl: boolean = false; + +// //#endregion + +// //#region Lifecycle + +// constructor() { +// AssetBundleMamager._instance = this; +// CC_PREVIEW && this._initdownloadList_Preview(); +// } + +// //#endregion + +// //#region Custom Function + +// /** +// * 取得Bundle +// * @param {string} BundleName Bundle名稱 +// * @param {string} Version 版號 +// * @return {cc.AssetManager.Bundle} Bundle +// */ +// public *GetBundle(BundleName: string, Version: string = ""): IterableIterator { +// let bundle: cc.AssetManager.Bundle = cc.assetManager.getBundle(BundleName); +// if (bundle) { +// return bundle; +// } + +// // options是可选参数,引擎会根据保留字段 进行对应的操作,这里添加了version和onFileProgress,可用来记录热更资源版本和下载进度 +// let options: any = null; + +// let BundleUrl: string = BundleName; +// if (cc.sys.isNative && !this.LocalVerList[BundleName].UseLocal) { +// BundleUrl = `${(jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "/")}Bundle/${BundleName}/remote/${BundleName}`; +// options = { +// version: Version +// }; +// } + +// cc.assetManager.loadBundle(BundleUrl, options, (err: Error, resp: cc.AssetManager.Bundle) => { +// if (err) { +// cc.error(err); +// bundle = null; +// } +// bundle = resp; +// }); +// while (typeof bundle === "undefined") { +// yield null; +// } + +// return bundle; +// } + +// /** +// * 更新Bundle +// * @param {HUDM} HUDName HUD +// */ +// public *UpdateBundle(HUDName: HUDM | string, onFileProgress?: (finish: number, total: number, item: string) => void): IterableIterator { +// let HUD: HUDM; +// if (HUDName instanceof HUDM) { +// HUD = HUDName; +// } else { +// HUD = this.GetHUD(HUDName); +// } +// let UpdateingData: Enum_Loading.UpdateingDataObj = yield* HUD.HUD(onFileProgress); +// if (UpdateingData.IsUpdatecomplete) { +// this.LocalVerList[HUD.BundleName] = this.RemoteVerList[HUD.BundleName]; +// this.LocalVerList[HUD.BundleName]["UseLocal"] = false; +// LocalStorageData.Instance.LocalVerList = JSON.stringify(this.LocalVerList); +// } +// return UpdateingData; +// } + +// /** +// * 更新Bundle +// * @param {HUDM} HUDName HUD +// */ +// public *RetryUpdateBundle(HUDName: HUDM | string, onFileProgress?: (finish: number, total: number, item: string) => void): IterableIterator { +// let HUD: HUDM; +// if (HUDName instanceof HUDM) { +// HUD = HUDName; +// } else { +// HUD = this.GetHUD(HUDName); +// } +// let UpdateingData: Enum_Loading.UpdateingDataObj = yield* HUD.RetryDownLoadFailedAssets(); +// return UpdateingData; +// } + +// /** +// * 從Bundle取得資源 +// * @param {cc.AssetManager.Bundle | string} BundleName Bundle名稱 +// * @param {string} SourceName 資源名稱 +// * @param {string} type 資源型別 +// * @return {any} Source +// */ +// public *GetBundleSource(BundleName: cc.AssetManager.Bundle | string, SourceName: string, type?: string | Bundle_Source_Type, onFileProgress?: (finish: number, total: number, item: cc.AssetManager.RequestItem) => void): IterableIterator { +// let bundle: cc.AssetManager.Bundle; +// let source: any; +// if (BundleName instanceof cc.AssetManager.Bundle) { +// bundle = BundleName; +// } else { +// bundle = cc.assetManager.getBundle(BundleName); +// if (!bundle) { +// cc.error(`GetBundleSource Error BundleName: ${BundleName}`); +// return null; +// } +// } + +// switch (type) { +// case Bundle_Source_Type.Scene: { +// bundle.loadScene(SourceName, onFileProgress, function (err: Error, scene: cc.SceneAsset): void { +// if (err) { +// cc.error(err); +// return null; +// } +// // cc.director.runScene(scene); +// source = scene; +// }); +// break; +// } + +// case Bundle_Source_Type.Json: { +// bundle.load(SourceName, onFileProgress, function (err: Error, json: cc.JsonAsset): void { +// if (err) { +// cc.error(err); +// return null; +// } +// // source = JSON.parse(json["_nativeAsset"]); +// source = json; +// }); +// break; +// } + +// case Bundle_Source_Type.Prefab: { +// bundle.load(SourceName, cc.Prefab, onFileProgress, function (err: Error, prefab: cc.Asset): void { +// if (err) { +// cc.error(err); +// return null; +// } +// // source = JSON.parse(json["_nativeAsset"]); +// source = prefab; +// }); +// break; +// } + +// default: +// bundle.load(SourceName, function (err: Error, any: any): void { +// if (err) { +// cc.error(err); +// return null; +// } +// source = any; +// }); +// break; +// } + +// while (typeof source === "undefined") { +// yield null; +// } +// return source; +// } + +// /** +// * 釋放Bundle +// * @param {string} slotID slotID +// */ +// public *BundleRelease(slotID: number): IterableIterator { +// let gameName: string = `Game_${slotID}`; +// let sceneName: string = `Slot${slotID}`; +// let bundle: cc.AssetManager.Bundle = cc.assetManager.getBundle(gameName); +// if (!bundle) { +// cc.log(`BundleRelease Error BundleName: ${gameName}`); +// return; +// } + +// // let bundles: cc.AssetManager.Cache = cc.assetManager.bundles; +// // let cacheDir: string = cc.assetManager.cacheManager.cacheDir; +// // let cachedFiles: Object = cc.assetManager.cacheManager.cachedFiles; + +// yield* this.DelBundleCache(bundle); +// yield* this.DelOthersCache(slotID); +// bundle.release(sceneName, cc.SceneAsset); +// cc.assetManager.removeBundle(bundle); +// cc.sys.garbageCollect(); +// } + +// /** +// * 從Bundle刪除暫存資源 +// * @param {string} BundleName Bundle名稱 +// */ +// public *DelBundleCache(BundleName: cc.AssetManager.Bundle | string): IterableIterator { +// if (!CC_JSB) { +// return; +// } +// let bundle: cc.AssetManager.Bundle; +// let source: any; +// if (BundleName instanceof cc.AssetManager.Bundle) { +// bundle = BundleName; +// } else { +// bundle = cc.assetManager.getBundle(BundleName); +// if (!bundle) { +// // cc.error(`GetBundleSource Error BundleName: ${BundleName}`); +// // return; +// bundle = yield* AssetBundleMamager.Instance.GetBundle(BundleName, this.RemoteVerList[BundleName].Version); +// } +// } + +// let _map: Object = bundle["_config"].assetInfos._map; +// for (let map of Object.keys(_map)) { +// let path: string = _map[map].path; +// if (!path) { +// break; +// } +// source = yield* AssetBundleMamager.Instance.GetBundleSource(bundle, path); +// cc.assetManager.cacheManager.removeCache(source.nativeUrl); +// bundle.release(path); +// // return; +// } +// } + +// /** +// * 從cachedFiles刪除暫存資源 +// * @param {number} slotID slotID +// */ +// public *DelOthersCache(slotID: number): IterableIterator { +// if (!CC_JSB) { +// return; +// } +// let cachedFiles: Object = cc.assetManager.cacheManager.cachedFiles["_map"]; +// let delcache_group: string[] = [`shared/jsons`, `Slot/Slot${slotID}`, "sounds/Slot/Default", `${BusinessTypeSetting.FolderUrlBundle}project.manifest`, "submit.txt"]; +// for (let cached of Object.keys(cachedFiles)) { +// for (var i: number = 0; i < delcache_group.length; ++i) { +// let delcache: string = delcache_group[i]; +// if (cached.includes(delcache)) { +// cc.assetManager.cacheManager.removeCache(cached); +// // console.log(`removeCache: ${cached}`); +// break; +// } +// } +// } +// } + +// public GetHUD(BundleName: HUDM | string): HUDM { +// let HUD: HUDM; +// if (BundleName instanceof HUDM) { +// HUD = BundleName; +// } else { +// if (!this.HUGroup.has(BundleName)) { +// HUD = new HUDM(BundleName); +// this.HUGroup.set(BundleName, HUD); +// } else { +// HUD = this.HUGroup.get(BundleName); +// } +// HUD = this.HUGroup.get(BundleName); +// } +// return HUD; +// } + +// /** 刪除全部暫存資源 */ +// public ClearAllCache(): void { +// cc.assetManager.cacheManager.clearCache(); +// cc.game.restart(); +// } + + +// public *CheckBundleNeedHUD(BundleName: HUDM | string): IterableIterator { +// let HUD: HUDM; +// if (BundleName instanceof HUDM) { +// HUD = BundleName; +// } else { +// HUD = this.GetHUD(BundleName); +// } +// if (!this.LocalVerList[HUD.BundleName]) { +// this.LocalVerList[HUD.BundleName] = new Enum_Loading.BundleDataObj(); +// let apkVersion: string = this.RemoteVerList[HUD.BundleName].ApkVersion; +// if (apkVersion && apkVersion !== "0") { +// this.LocalVerList[HUD.BundleName].UseLocal = true; +// this.LocalVerList[HUD.BundleName].Version = apkVersion; +// } +// LocalStorageData.Instance.LocalVerList = JSON.stringify(this.LocalVerList); +// } else { +// if (this.RemoteVerList[HUD.BundleName].Version === this.RemoteVerList[HUD.BundleName].ApkVersion) { +// this.LocalVerList[HUD.BundleName] = this.RemoteVerList[HUD.BundleName]; +// this.LocalVerList[HUD.BundleName].UseLocal = true; +// } +// } +// let UpdateData: Enum_Loading.NeedUpdateDataObj = new Enum_Loading.NeedUpdateDataObj(); +// if (this.LocalVerList[HUD.BundleName].UseLocal) { +// UpdateData.IsNeedUpdate = AssetBundleMamager.Instance.versionCompareHandle(this.LocalVerList[HUD.BundleName].Version, this.RemoteVerList[HUD.BundleName].Version) < 0 ? true : false; +// if (UpdateData.IsNeedUpdate) { +// UpdateData = yield* HUD.CheckUpdate(); +// } +// } else { +// UpdateData = yield* HUD.CheckUpdate(); +// } +// return UpdateData; +// } + +// // public *CheckBundleNeedHUD(BundleName: string): IterableIterator { +// // if (!this.LocalVerList[BundleName]) { +// // this.LocalVerList[BundleName] = new Enum_Loading.BundleDataObj(); +// // let apkVersion: string = this.RemoteVerList[BundleName].ApkVersion; +// // if (apkVersion && apkVersion !== "0") { +// // this.LocalVerList[BundleName].UseLocal = true; +// // this.LocalVerList[BundleName].Version = apkVersion; +// // } +// // LocalStorageData.Instance.LocalVerList = JSON.stringify(this.LocalVerList); +// // } +// // let IsUpdate: boolean = AssetBundleMamager.Instance.versionCompareHandle(this.LocalVerList[BundleName].Version, this.RemoteVerList[BundleName].Version) < 0 ? true : false; +// // return IsUpdate; +// // } + +// public CheckGameNeedUpdate(GameID: number): boolean { +// let IsUpdate: boolean = false; +// let bundleName: string = `Game_${GameID}`; +// if (!this.RemoteVerList[bundleName]) { +// this.RemoteVerList[bundleName] = new Enum_Loading.BundleDataObj(); +// this.RemoteVerList[bundleName].HasBundle = false; +// LocalStorageData.Instance.RemoteVerList = JSON.stringify(this.RemoteVerList); +// IsUpdate = true; +// } +// if (!this.LocalVerList[bundleName]) { +// this.LocalVerList[bundleName] = new Enum_Loading.BundleDataObj(); +// let apkVersion: string = this.RemoteVerList[bundleName].ApkVersion; +// if (apkVersion && apkVersion !== "0") { +// this.LocalVerList[bundleName].UseLocal = true; +// this.LocalVerList[bundleName].Version = apkVersion; +// } +// LocalStorageData.Instance.LocalVerList = JSON.stringify(this.LocalVerList); +// } +// if (CC_PREVIEW) { +// return this._getIsDownload_Preview(GameID); +// } +// if (IsUpdate) { +// return IsUpdate; +// } +// IsUpdate = AssetBundleMamager.Instance.versionCompareHandle(this.LocalVerList[bundleName].Version, this.RemoteVerList[bundleName].Version) < 0 ? true : false; +// return IsUpdate; +// } + +// /** +// * 比對版號(熱更能從1.0.0更新到2.0.0,從2.0.0回退到1.0.0) +// * 官方提供的版本比較函數,只有服務端版本>客戶端版本時,才會進行更新。所以不能從2.0.0回退到1.0.0版本。 +// * @param {string} versionA 本地版號 +// * @param {string} versionB 遠程版號 +// * @return {number} num = -1 須更新 +// * @return {number} num = 0 不須更新 +// */ +// public versionCompareHandle(versionA: string, versionB: string): number { +// // console.log("Ver A " + versionA + "VerB " + versionB); +// var vA: string[] = versionA.split("."); +// var vB: string[] = versionB.split("."); + +// // 長度不相等,則進行更新 +// if (vA.length !== vB.length) { +// return -1; +// } + +// for (var i: number = 0; i < vA.length; ++i) { +// var a: number = +vA[i]; +// var b: number = +vB[i] || 0; +// if (a === b) { +// // 數字相同,則跳過 +// continue; +// } else { +// // 數字不同,則進行更新 +// return -1; +// } +// } + +// // 長度相等且數字相等,則不更新 +// return 0; +// } + +// //#endregion + +// //#region DownloadList_Preview + +// private _initdownloadList_Preview(): void { +// this.DownloadList_Preview = JSON.parse(LocalStorageData.Instance.DownloadList_Preview); +// this.DownloadList_Preview = this.DownloadList_Preview ? this.DownloadList_Preview : {}; +// } + +// private _getIsDownload_Preview(slotID: number): boolean { +// if (!this.DownloadList_Preview[slotID]) { +// this.SetIsDownload_Preview(slotID, false); +// } +// return !this.DownloadList_Preview[slotID]; +// } + +// public SetIsDownload_Preview(slotID: number, isDownload: boolean = true): void { +// this.DownloadList_Preview[slotID] = isDownload; +// LocalStorageData.Instance.DownloadList_Preview = JSON.stringify(this.DownloadList_Preview); +// } + +// //#endregion +// } + +// //#region enum + +// /** Bundle資源類型 */ +// export enum Bundle_Source_Type { +// /** Json */ +// Json = "json", + +// /** Scene */ +// Scene = "scene", + +// /** Prefab */ +// Prefab = "prefab" +// } + +// //#endregion + +// //#region 廢棄 Function + +// // /** +// // * 從Bundle刪除暫存資源 +// // * @param {string} BundleName Bundle名稱 +// // */ +// // public *DelBundleCache(BundleName: cc.AssetManager.Bundle | string): IterableIterator { +// // if (!CC_JSB) { +// // return; +// // } +// // let WritablePath: string = `${jsb.fileUtils.getWritablePath()}gamecaches/${BundleName}`; +// // if (jsb.fileUtils.isDirectoryExist(WritablePath)) { +// // jsb.fileUtils.removeDirectory(WritablePath); +// // } +// // } + +// //#endregion \ No newline at end of file diff --git a/assets/Script/HUD/AssetBundleMamager.ts.meta b/assets/Script/HUD/AssetBundleMamager.ts.meta new file mode 100644 index 0000000..b228b49 --- /dev/null +++ b/assets/Script/HUD/AssetBundleMamager.ts.meta @@ -0,0 +1,10 @@ +{ + "ver": "1.1.0", + "uuid": "97a0b2c9-72f8-4797-874a-263e4558f765", + "importer": "typescript", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/HUD/Enum_HUDM.ts b/assets/Script/HUD/Enum_HUDM.ts new file mode 100644 index 0000000..7a1923d --- /dev/null +++ b/assets/Script/HUD/Enum_HUDM.ts @@ -0,0 +1,72 @@ +const { ccclass, property } = cc._decorator; +export module Enum_HUDM { + + //#region Enum + + //#endregion + + //#region Class + + // /** BaseBundle資料 */ + // @ccclass("BaseBundleObj") + // export class BaseBundleObj { + // @property({ displayName: "Bundle名稱", tooltip: "Bundle名稱" }) + // public BundleName: string = ""; + + // @property({ displayName: "優先度", tooltip: "優先度", type: cc.Integer }) + // public Priority: number = 1; + // } + + class BundleDictionary { + [x: string]: T; + } + + /** VerList資料 */ + @ccclass("VerListObj") + export class VerListObj extends BundleDictionary { + } + + /** Bundle資料 */ + @ccclass("BundleDataObj") + export class BundleDataObj { + public Version: string = "0"; + + public ApkVersion: string = "0"; + + public UseLocal: boolean = false; + + /** 有沒有包到Bundle */ + public HasBundle: boolean = true; + } + + /** Bundle資料 */ + @ccclass("NeedUpdateDataObj") + export class NeedUpdateDataObj { + + /** 是否需要更新 */ + public IsNeedUpdate: boolean; + + /** 更新大小 */ + public TotalBytes: string; + + constructor(...params: any[]) { + this.IsNeedUpdate = params[0]; + this.TotalBytes = params[1] ? params[1] : null; + } + } + + /** Bundle資料 */ + @ccclass("UpdateingDataObj") + export class UpdateingDataObj { + + /** 是否更新完成 */ + public IsUpdatecomplete: boolean; + + constructor(...params: any[]) { + this.IsUpdatecomplete = params[0]; + } + } + + //#endregion +} +export default Enum_HUDM; \ No newline at end of file diff --git a/assets/Script/HUD/Enum_HUDM.ts.meta b/assets/Script/HUD/Enum_HUDM.ts.meta new file mode 100644 index 0000000..3b56ade --- /dev/null +++ b/assets/Script/HUD/Enum_HUDM.ts.meta @@ -0,0 +1,10 @@ +{ + "ver": "1.1.0", + "uuid": "7217469f-9c06-46fd-be21-69020675c24d", + "importer": "typescript", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/HUD/HUDM.ts b/assets/Script/HUD/HUDM.ts new file mode 100644 index 0000000..2ae493b --- /dev/null +++ b/assets/Script/HUD/HUDM.ts @@ -0,0 +1,353 @@ +import { CoroutineV2 } from "../Engine/CatanEngine/CoroutineV2/CoroutineV2"; +import UpdatePanel from "../UpdatePanel"; +import Enum_HUDM from "./Enum_HUDM"; + +const { ccclass, property } = cc._decorator; + +/** HUDManager */ +@ccclass +export default class HUDM extends cc.Component { + + //#region static 屬性 + + private static _instance: HUDM = null; + public static get Instance(): HUDM { return HUDM._instance; } + + //#endregion + + //#region private 屬性 + + private _updatePanel: UpdatePanel; + private _am: jsb.AssetsManager; + private _onFileProgress: (finish: number, total: number, item: string) => void; + private _updateListener: any; + private _checkListener: any; + private _versionCompareHandle: any = null; + private _needUpdateData: Enum_HUDM.NeedUpdateDataObj = null; + private _updateingData: Enum_HUDM.UpdateingDataObj = null; + private _updating: boolean = false; + private _canRetry: boolean = false; + private _isChangeUrl: boolean = false; + private _path: string = "Bundle"; + private _customManifest: string = ""; + private _storagePath: string = ""; + + //#endregion + + //#region Lifecycle + + constructor(...params: any[]) { + super(); + + if (!cc.sys.isNative) { + return; + } + HUDM._instance = this; + this._updatePanel = params[0]; + + // let packageUrl: string = params[1]; + // let BundleData: Enum_Loading.BundleDataObj = AssetBundleMamager.Instance.RemoteVerList[this.BundleName]; + // let packageUrl: string = BundleData.BundleUrl; + let packageUrl: string = `https://jianmiau.tk/Resources/App/JMKA/update/remote-assets`; + + this._customManifest = JSON.stringify({ + "packageUrl": packageUrl, + "remoteManifestUrl": `${packageUrl}/project.manifest`, + "remoteVersionUrl": `${packageUrl}/version.json`, + "version": "1.0.0", + }); + + this._storagePath = `${(jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "./")}${this._path}`; + + this._versionCompareHandle = function (versionA: string, versionB: string): number { + // console.log("Ver A " + versionA + "VerB " + versionB); + let vA: string[] = versionA.split("."); + let vB: string[] = versionB.split("."); + + // 長度不相等,則進行更新 + if (vA.length !== vB.length) { + return -1; + } + + for (let i: number = 0; i < vA.length; ++i) { + let a: number = +vA[i]; + let b: number = +vB[i] || 0; + if (a === b) { + // 數字相同,則跳過 + continue; + } else { + // 數字不同,則進行更新 + return -1; + } + } + + // 長度相等且數字相等,則不更新 + return 0; + }; + this._initAssetManaget(); + } + private _initAssetManaget(): void { + let self: this = this; + // + this._am = new jsb.AssetsManager("", this._storagePath, this._versionCompareHandle); + + // Setup the verification callback, but we don't have md5 check function yet, so only print some message + // Return true if the verification passed, otherwise return false + this._am.setVerifyCallback(function (path: any, asset: { compressed: any; md5: any; path: any; size: any; }): boolean { + // When asset is compressed, we don't need to check its md5, because zip file have been deleted. + let compressed: any = asset.compressed; + // Retrieve the correct md5 value. + let expectedMD5: string = asset.md5; + // asset.path is relative path and path is absolute. + let relativePath: string = asset.path; + // The size of asset file, but this value could be absent. + let size: any = asset.size; + if (compressed) { + self._updatePanel.info.string = "Verification passed : " + relativePath; + // console.log("onLoad -> Verification passed : " + relativePath); + return true; + } else { + self._updatePanel.info.string = "Verification passed : " + relativePath + " (" + expectedMD5 + ")"; + // console.log("onLoad -> setVerifyCallbackVerification passed : " + relativePath + " (" + expectedMD5 + ")"); + return true; + } + }); + + if (cc.sys.os === cc.sys.OS_ANDROID) { + // Some Android device may slow down the download process when concurrent tasks is too much. + // The value may not be accurate, please do more test and find what's most suitable for your game. + // this._am.setMaxConcurrentTask(10); + this._am["setMaxConcurrentTask"](10); + // this._updatePanel.info.string = "Max concurrent tasks count have been limited to 2"; + // console.log("onLoad -> Max concurrent tasks count have been limited to 10"); + } + } + + //#endregion + + public *CheckUpdate(): IterableIterator { + this._needUpdateData = null; + if (this._updating) { + this._updatePanel.info.string = "Checking or updating ..."; + console.error("checkUpdate -> Checking or updating ..."); + return; + } + + if (this._am.getState() === jsb.AssetsManager.State.UNINITED) { + let manifest: jsb.Manifest = new jsb.Manifest(this._customManifest, this._storagePath); + this._am.loadLocalManifest(manifest, this._storagePath); + } + if (!this._am.getLocalManifest() || !this._am.getLocalManifest().isLoaded()) { + // this.tipsLabel.string = "Failed to load local manifest ..."; + console.error("checkUpdate -> Failed to load local manifest ..."); + return; + } + this._am.setEventCallback(this.checkCb.bind(this)); + + this._am.checkUpdate(); + this._updating = true; + + while (this._needUpdateData === null) { + yield null; + } + + return this._needUpdateData; + } + + private checkCb(event: jsb.EventAssetsManager): void { + let failed: boolean = false; + switch (event.getEventCode()) { + case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST: + console.error("checkCb -> No local manifest file found, HUD skipped."); + failed = true; + break; + case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST: + case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST: + console.error("checkCb -> Fail to download manifest file, HUD skipped."); + failed = true; + break; + case jsb.EventAssetsManager.ALREADY_UP_TO_DATE: + console.log("checkCb -> Already up to date with the latest remote version."); + this._needUpdateData = new Enum_HUDM.NeedUpdateDataObj(false); + break; + case jsb.EventAssetsManager.NEW_VERSION_FOUND: + this._updatePanel.checkBtn.active = false; + this._updatePanel.fileProgress.progress = 0; + this._updatePanel.byteProgress.progress = 0; + this._updatePanel.info.string = "發現新版本,請嘗試更新。 " + this._bytesToSize(event.getTotalBytes()); + console.log("checkCb -> New version found, please try to update." + event.getTotalBytes()); + this._needUpdateData = new Enum_HUDM.NeedUpdateDataObj(true, this._bytesToSize(event.getTotalBytes())); + break; + default: + return; + } + + this._am.setEventCallback(null); + this._checkListener = null; + this._updating = false; + + if (failed) { + this._needUpdateData = new Enum_HUDM.NeedUpdateDataObj(false, null); + } + } + + public *HUD(onFileProgress?: (finish: number, total: number, item: string) => void): IterableIterator { + this._updateingData = null; + if (this._am && !this._updating) { + this._am.setEventCallback(this._updateCb.bind(this)); + + if (this._am.getState() === jsb.AssetsManager.State.UNINITED) { + let manifest: jsb.Manifest = new jsb.Manifest(this._customManifest, this._storagePath); + this._am.loadLocalManifest(manifest, this._storagePath); + } + + this._onFileProgress = onFileProgress ? onFileProgress : null; + this._am.update(); + this._updating = true; + + while (this._updateingData === null) { + yield null; + } + + return this._updateingData; + } else { + return new Enum_HUDM.UpdateingDataObj(false); + } + } + + private _updateCb(event: jsb.EventAssetsManager): void { + let self: this = this; + let needRestart: boolean = false; + let failed: boolean = false; + switch (event.getEventCode()) { + case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST: + this._updatePanel.info.string = "No local manifest file found, HUD skipped."; + console.log("updateCb -> No local manifest file found, HUD skipped."); + failed = true; + break; + case jsb.EventAssetsManager.UPDATE_PROGRESSION: + this._updatePanel.byteProgress.progress = event.getPercent(); + this._updatePanel.fileProgress.progress = event.getPercentByFile(); + this._updatePanel.fileLabel.string = event.getDownloadedFiles() + " / " + event.getTotalFiles(); + // this.tipsLabel.string = event.getDownloadedBytes() + " / " + event.getTotalBytes(); + + // console.log("updateCb -> " + event.getDownloadedBytes() + " / " + event.getTotalBytes()); + // let msg: string = event.getMessage(); + // if (msg) { + // this._updatePanel.info.string = 'Updated file: ' + msg; + // console.log("updateCb -> Updated file: " + msg); + // console.log("updateCb -> " + event.getPercent() / 100 + "% : " + msg); + // } + + let msg: string = event.getMessage(); + if (this._onFileProgress) { + this._onFileProgress(event.getDownloadedBytes(), event.getTotalBytes(), msg ? msg : ""); + } + break; + case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST: + case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST: + this._updatePanel.info.string = "Fail to download manifest file, HUD skipped."; + console.error("updateCb -> Fail to download manifest file, HUD skipped."); + failed = true; + break; + case jsb.EventAssetsManager.ALREADY_UP_TO_DATE: + this._updatePanel.info.string = "Already up to date with the latest remote version."; + console.error("updateCb -> Already up to date with the latest remote version."); + failed = true; + break; + case jsb.EventAssetsManager.UPDATE_FINISHED: + // this.tipsLabel.string = "更新完成. " + event.getMessage(); + console.log("updateCb -> 更新完成. " + event.getMessage()); + this._updateingData = new Enum_HUDM.UpdateingDataObj(true); + needRestart = true; + break; + case jsb.EventAssetsManager.UPDATE_FAILED: + this._updatePanel.info.string = "Update failed. " + event.getMessage(); + console.error("updateCb -> Update failed. " + event.getMessage()); + this._updatePanel.retryBtn.active = true; + this._canRetry = true; + this._updateingData = new Enum_HUDM.UpdateingDataObj(false); + this._updating = false; + break; + case jsb.EventAssetsManager.ERROR_UPDATING: + this._updatePanel.info.string = "Asset update error: " + event.getAssetId() + ", " + event.getMessage(); + console.error("updateCb -> Asset update error: " + event.getAssetId() + ", " + event.getMessage()); + break; + case jsb.EventAssetsManager.ERROR_DECOMPRESS: + this._updatePanel.info.string = event.getMessage(); + console.error("updateCb -> " + event.getMessage()); + break; + default: + break; + } + + if (failed) { + this._am.setEventCallback(null); + this._updateListener = null; + this._updating = false; + } + + if (needRestart) { + let AsyncFunction: () => IterableIterator = function* (): IterableIterator { + self._updatePanel.info.string = "更新完成 即將重啟"; + // 卡個一幀不然都看不到100%的畫面 + yield CoroutineV2.WaitTime(5 / cc.game.getFrameRate()).Start(); + + self._am.setEventCallback(null); + self._updateListener = null; + // Prepend the manifest's search path + let searchPaths: string[] = jsb.fileUtils.getSearchPaths(); + let newPaths: [string] = self._am.getLocalManifest().getSearchPaths(); + console.log(JSON.stringify(newPaths)); + Array.prototype.unshift.apply(searchPaths, newPaths); + // This value will be retrieved and appended to the default search path during game startup, + // please refer to samples/js-tests/main.js for detailed usage. + // !!! Re-add the search paths in main.js is very important, otherwise, new scripts won't take effect. + cc.sys.localStorage.setItem("HotUpdateSearchPaths", JSON.stringify(searchPaths)); + jsb.fileUtils.setSearchPaths(searchPaths); + + cc.audioEngine.stopAll(); + cc.game.restart(); + }; + CoroutineV2.Single(AsyncFunction()).Start(); + } + } + + public *RetryDownLoadFailedAssets(): IterableIterator { + if (!this._updating && this._canRetry) { + this._updateingData = null; + this._updatePanel.retryBtn.active = false; + this._canRetry = false; + + this._updatePanel.info.string = "Retry failed Assets..."; + console.log("retry -> Retry failed Assets..."); + this._am.downloadFailedAssets(); + + while (this._updateingData === null) { + yield null; + } + + return this._updateingData; + } else { + console.error(`retry -> error updating: ${this._updating}, canRetry: ${this._canRetry}`); + this._updateingData = new Enum_HUDM.UpdateingDataObj(false); + } + } + + private _bytesToSize(bytes: number): string { + if (bytes === 0) { + return "0 B"; + } + let k: number = 1024; + let sizes: string[] = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; + let i: number = Math.floor(Math.log(bytes) / Math.log(k)); + return (bytes / Math.pow(k, i)).toPrecision(3) + " " + sizes[i]; + } + + protected onDestroy(): void { + if (this._updateListener) { + this._am.setEventCallback(null); + this._updateListener = null; + } + } +} diff --git a/assets/Script/HUD/HUDM.ts.meta b/assets/Script/HUD/HUDM.ts.meta new file mode 100644 index 0000000..cd48b0e --- /dev/null +++ b/assets/Script/HUD/HUDM.ts.meta @@ -0,0 +1,10 @@ +{ + "ver": "1.1.0", + "uuid": "dd9501f7-957a-4e62-8630-d43f62d171d1", + "importer": "typescript", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/Manager.ts b/assets/Script/Manager.ts index 90f278d..343c5d1 100644 --- a/assets/Script/Manager.ts +++ b/assets/Script/Manager.ts @@ -1,6 +1,15 @@ +/* + +node version_generator.js -v 1.0.0 -u https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/ -s build/jsb-default/remote-assets -d remote-assets + +*/ + import { CoroutineV2 } from "./Engine/CatanEngine/CoroutineV2/CoroutineV2"; import { System_Eevent } from "./Engine/CatanEngine/CSharp/System/System_Eevent"; +import { Enum_HUDM } from "./HUD/Enum_HUDM"; +import HUDM from "./HUD/HUDM"; import NativeClass from "./NativeClass"; +import UpdatePanel from "./UpdatePanel"; const { ccclass, property } = cc._decorator; @@ -14,23 +23,35 @@ export default class Manager extends cc.Component { @property({ type: cc.Node }) public BG: cc.Node = null; - //#endregion - - //#region private - - // private _text_to_Speech: Text_to_Speech; + @property({ type: cc.Node }) + public UpdatePanel: cc.Node = null; //#endregion //#region Lifecycle protected onLoad(): void { + CoroutineV2.Single(this._init()).Start(); + } + + private *_init(): IterableIterator { + console.log(`2022/08/30 16:26`); cc.debug.setDisplayStats(false); if (CC_DEBUG) { console.log("Debug"); } new NativeClass(this.webview); + if (cc.sys.isNative) { + new HUDM(this.UpdatePanel.getComponentInChildren(UpdatePanel)); + let needUpdateData: Enum_HUDM.NeedUpdateDataObj = yield* HUDM.Instance.CheckUpdate(); + if (needUpdateData.IsNeedUpdate) { + this.UpdatePanel.active = true; + return; + } else { + this.UpdatePanel.active = false; + } + } let self: this = this; // this._text_to_Speech = new Text_to_Speech(); @@ -115,7 +136,7 @@ export default class Manager extends cc.Component { public *GetFCMToken(): IterableIterator { const FCMToken: string = NativeClass.Instance.GetFCMToken(); - if (!FCMToken) { + if (cc.sys.os === cc.sys.OS_IOS && !FCMToken) { yield CoroutineV2.WaitTime(1); yield this.GetFCMToken(); return; diff --git a/assets/Script/UpdatePanel.ts b/assets/Script/UpdatePanel.ts new file mode 100644 index 0000000..92cdfd6 --- /dev/null +++ b/assets/Script/UpdatePanel.ts @@ -0,0 +1,73 @@ +import { CoroutineV2 } from "./Engine/CatanEngine/CoroutineV2/CoroutineV2"; +import { Enum_HUDM } from "./HUD/Enum_HUDM"; +import HUDM from "./HUD/HUDM"; + +const { ccclass, property } = cc._decorator; + +@ccclass +export default class UpdatePanel extends cc.Component { + //#region 外調參數 + + @property({ type: cc.Label }) + public info: cc.Label = null; + + @property({ type: cc.ProgressBar }) + public fileProgress: cc.ProgressBar = null; + + @property({ type: cc.Label }) + public fileLabel: cc.Label = null; + + @property({ type: cc.ProgressBar }) + public byteProgress: cc.ProgressBar = null; + + @property({ type: cc.Label }) + public byteLabel: cc.Label = null; + + @property({ type: cc.Node }) + public close: cc.Node = null; + + @property({ type: cc.Node }) + public checkBtn: cc.Node = null; + + @property({ type: cc.Node }) + public retryBtn: cc.Node = null; + + @property({ type: cc.Node }) + public updateBtn: cc.Node = null; + + //#endregion + + //#region Lifecycle + + protected onLoad(): void { + let self: this = this; + this.close.on(cc.Node.EventType.TOUCH_END, () => { + self.node.active = false; + }, this); + + this.node.getChildByName("update_btn").on("click", () => { CoroutineV2.Single(this.OnClickUpdate()).Start(); }, this); + this.node.getChildByName("check_btn").on("click", () => { CoroutineV2.Single(this.OnClickCheck()).Start(); }, this); + this.node.getChildByName("retry_btn").on("click", () => { CoroutineV2.Single(this.OnClickRetry()).Start(); }, this); + } + + //#endregion + + //#region OnClick + + public *OnClickUpdate(): IterableIterator { + let updateingData: Enum_HUDM.UpdateingDataObj = yield* HUDM.Instance.HUD(); + return; + } + + public *OnClickCheck(): IterableIterator { + let needUpdateData: Enum_HUDM.NeedUpdateDataObj = yield* HUDM.Instance.CheckUpdate(); + return; + } + + public *OnClickRetry(): IterableIterator { + let updateingData: Enum_HUDM.UpdateingDataObj = yield* HUDM.Instance.RetryDownLoadFailedAssets(); + return; + } + + //#endregion +} diff --git a/assets/Script/UpdatePanel.ts.meta b/assets/Script/UpdatePanel.ts.meta new file mode 100644 index 0000000..27fe8b9 --- /dev/null +++ b/assets/Script/UpdatePanel.ts.meta @@ -0,0 +1,10 @@ +{ + "ver": "1.1.0", + "uuid": "86711b47-13f6-4a4e-8a9d-0e24e7fca6e7", + "importer": "typescript", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Texture/UI.meta b/assets/Texture/UI.meta new file mode 100644 index 0000000..c9ec5e0 --- /dev/null +++ b/assets/Texture/UI.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.3", + "uuid": "e47b98da-e2c8-4c74-9530-0f718d04b512", + "importer": "folder", + "isBundle": false, + "bundleName": "", + "priority": 1, + "compressionType": {}, + "optimizeHotUpdate": {}, + "inlineSpriteFrames": {}, + "isRemoteBundle": {}, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Texture/UI/chat.meta b/assets/Texture/UI/chat.meta new file mode 100644 index 0000000..570719d --- /dev/null +++ b/assets/Texture/UI/chat.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.3", + "uuid": "72d8bf4e-9f48-4cdc-9121-eb140ee30407", + "importer": "folder", + "isBundle": false, + "bundleName": "", + "priority": 1, + "compressionType": {}, + "optimizeHotUpdate": {}, + "inlineSpriteFrames": {}, + "isRemoteBundle": {}, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Texture/UI/chat/button_orange.png b/assets/Texture/UI/chat/button_orange.png new file mode 100644 index 0000000..e9eac00 Binary files /dev/null and b/assets/Texture/UI/chat/button_orange.png differ diff --git a/assets/Texture/UI/chat/button_orange.png.meta b/assets/Texture/UI/chat/button_orange.png.meta new file mode 100644 index 0000000..0c2befb --- /dev/null +++ b/assets/Texture/UI/chat/button_orange.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "3459ab36-782c-4c4e-8aef-7280aff8b272", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 240, + "height": 95, + "platformSettings": {}, + "subMetas": { + "button_orange": { + "ver": "1.0.6", + "uuid": "c01466ea-7283-4fce-b615-4ee78c774af0", + "importer": "sprite-frame", + "rawTextureUuid": "3459ab36-782c-4c4e-8aef-7280aff8b272", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 240, + "height": 95, + "rawWidth": 240, + "rawHeight": 95, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/Texture/UI/chat/gb_inputbox.png b/assets/Texture/UI/chat/gb_inputbox.png new file mode 100644 index 0000000..eb2ad6f Binary files /dev/null and b/assets/Texture/UI/chat/gb_inputbox.png differ diff --git a/assets/Texture/UI/chat/gb_inputbox.png.meta b/assets/Texture/UI/chat/gb_inputbox.png.meta new file mode 100644 index 0000000..90ec75b --- /dev/null +++ b/assets/Texture/UI/chat/gb_inputbox.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "c39ea496-96eb-4dc5-945a-e7c919b77c21", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 54, + "height": 81, + "platformSettings": {}, + "subMetas": { + "gb_inputbox": { + "ver": "1.0.6", + "uuid": "7d1d4e60-aba2-48e8-85f8-8e328f34e7cc", + "importer": "sprite-frame", + "rawTextureUuid": "c39ea496-96eb-4dc5-945a-e7c919b77c21", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 54, + "height": 81, + "rawWidth": 54, + "rawHeight": 81, + "borderTop": 11, + "borderBottom": 11, + "borderLeft": 12, + "borderRight": 12, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/Texture/UI/new.meta b/assets/Texture/UI/new.meta new file mode 100644 index 0000000..a371a70 --- /dev/null +++ b/assets/Texture/UI/new.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.3", + "uuid": "d695c8b9-c7e7-4290-84e5-c10e9988e966", + "importer": "folder", + "isBundle": false, + "bundleName": "", + "priority": 1, + "compressionType": {}, + "optimizeHotUpdate": {}, + "inlineSpriteFrames": {}, + "isRemoteBundle": {}, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Texture/UI/new/bg_rankinglist.png b/assets/Texture/UI/new/bg_rankinglist.png new file mode 100644 index 0000000..594f947 Binary files /dev/null and b/assets/Texture/UI/new/bg_rankinglist.png differ diff --git a/assets/Texture/UI/new/bg_rankinglist.png.meta b/assets/Texture/UI/new/bg_rankinglist.png.meta new file mode 100644 index 0000000..17ea162 --- /dev/null +++ b/assets/Texture/UI/new/bg_rankinglist.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "700faa17-11a6-46cd-aeb5-d6900bc264f8", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 504, + "height": 144, + "platformSettings": {}, + "subMetas": { + "bg_rankinglist": { + "ver": "1.0.6", + "uuid": "ca7dd73d-526a-4c85-9702-eb51e93b9d99", + "importer": "sprite-frame", + "rawTextureUuid": "700faa17-11a6-46cd-aeb5-d6900bc264f8", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 504, + "height": 144, + "rawWidth": 504, + "rawHeight": 144, + "borderTop": 69, + "borderBottom": 36, + "borderLeft": 36, + "borderRight": 36, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/Texture/UI/new/icon_back.png b/assets/Texture/UI/new/icon_back.png new file mode 100644 index 0000000..49da54d Binary files /dev/null and b/assets/Texture/UI/new/icon_back.png differ diff --git a/assets/Texture/UI/new/icon_back.png.meta b/assets/Texture/UI/new/icon_back.png.meta new file mode 100644 index 0000000..37fbf94 --- /dev/null +++ b/assets/Texture/UI/new/icon_back.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "2ddfe005-2129-41d8-aeec-2b1f51f02962", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 33, + "height": 48, + "platformSettings": {}, + "subMetas": { + "icon_back": { + "ver": "1.0.6", + "uuid": "6035fac6-5208-4e0b-bea7-62ff9fb1338b", + "importer": "sprite-frame", + "rawTextureUuid": "2ddfe005-2129-41d8-aeec-2b1f51f02962", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 33, + "height": 48, + "rawWidth": 33, + "rawHeight": 48, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/Texture/UI/table.meta b/assets/Texture/UI/table.meta new file mode 100644 index 0000000..cb2171f --- /dev/null +++ b/assets/Texture/UI/table.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.3", + "uuid": "7e51bdf1-1b2e-4de4-9e05-b9c9715f6229", + "importer": "folder", + "isBundle": false, + "bundleName": "", + "priority": 1, + "compressionType": {}, + "optimizeHotUpdate": {}, + "inlineSpriteFrames": {}, + "isRemoteBundle": {}, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Texture/UI/table/bg_jinbishu.png b/assets/Texture/UI/table/bg_jinbishu.png new file mode 100644 index 0000000..3bf29d3 Binary files /dev/null and b/assets/Texture/UI/table/bg_jinbishu.png differ diff --git a/assets/Texture/UI/table/bg_jinbishu.png.meta b/assets/Texture/UI/table/bg_jinbishu.png.meta new file mode 100644 index 0000000..5b12770 --- /dev/null +++ b/assets/Texture/UI/table/bg_jinbishu.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "caaaf9ff-5036-4232-a8a7-88b80b2e4c88", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 40, + "height": 30, + "platformSettings": {}, + "subMetas": { + "bg_jinbishu": { + "ver": "1.0.6", + "uuid": "022a80ab-4cde-42ca-9e04-8a23745cf138", + "importer": "sprite-frame", + "rawTextureUuid": "caaaf9ff-5036-4232-a8a7-88b80b2e4c88", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 40, + "height": 30, + "rawWidth": 40, + "rawHeight": 30, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 11, + "borderRight": 12, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/build-templates/jsb-default/frameworks/runtime-src/proj.android-studio/res/values/strings.xml b/build-templates/jsb-default/frameworks/runtime-src/proj.android-studio/res/values/strings.xml index 4ae115c..42ca887 100644 --- a/build-templates/jsb-default/frameworks/runtime-src/proj.android-studio/res/values/strings.xml +++ b/build-templates/jsb-default/frameworks/runtime-src/proj.android-studio/res/values/strings.xml @@ -1,4 +1,4 @@ - 爆機娛樂城 + 卡羅記帳 \ No newline at end of file diff --git a/build-templates/jsb-default/main.js b/build-templates/jsb-default/main.js new file mode 100644 index 0000000..d6169f7 --- /dev/null +++ b/build-templates/jsb-default/main.js @@ -0,0 +1,149 @@ +window.boot = function () { + var settings = window._CCSettings; + window._CCSettings = undefined; + var onProgress = null; + + var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES; + var INTERNAL = cc.AssetManager.BuiltinBundleName.INTERNAL; + var MAIN = cc.AssetManager.BuiltinBundleName.MAIN; + function setLoadingDisplay() { + // Loading splash scene + var splash = document.getElementById('splash'); + var progressBar = splash.querySelector('.progress-bar span'); + onProgress = function (finish, total) { + var percent = 100 * finish / total; + if (progressBar) { + progressBar.style.width = percent.toFixed(2) + '%'; + } + }; + splash.style.display = 'block'; + progressBar.style.width = '0%'; + + cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () { + splash.style.display = 'none'; + }); + } + + var onStart = function () { + + cc.view.enableRetina(true); + cc.view.resizeWithBrowserSize(true); + + if (cc.sys.isBrowser) { + setLoadingDisplay(); + } + + if (cc.sys.isMobile) { + if (settings.orientation === 'landscape') { + cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE); + } + else if (settings.orientation === 'portrait') { + cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT); + } + cc.view.enableAutoFullScreen([ + cc.sys.BROWSER_TYPE_BAIDU, + cc.sys.BROWSER_TYPE_BAIDU_APP, + cc.sys.BROWSER_TYPE_WECHAT, + cc.sys.BROWSER_TYPE_MOBILE_QQ, + cc.sys.BROWSER_TYPE_MIUI, + cc.sys.BROWSER_TYPE_HUAWEI, + cc.sys.BROWSER_TYPE_UC, + ].indexOf(cc.sys.browserType) < 0); + } + + // Limit downloading max concurrent task to 2, + // more tasks simultaneously may cause performance draw back on some android system / browsers. + // You can adjust the number based on your own test result, you have to set it before any loading process to take effect. + if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) { + cc.assetManager.downloader.maxConcurrency = 2; + cc.assetManager.downloader.maxRequestsPerFrame = 2; + } + + var launchScene = settings.launchScene; + var bundle = cc.assetManager.bundles.find(function (b) { + return b.getSceneInfo(launchScene); + }); + + bundle.loadScene(launchScene, null, onProgress, + function (err, scene) { + if (!err) { + cc.director.runSceneImmediate(scene); + if (cc.sys.isBrowser) { + // show canvas + var canvas = document.getElementById('GameCanvas'); + canvas.style.visibility = ''; + var div = document.getElementById('GameDiv'); + if (div) { + div.style.backgroundImage = ''; + } + console.log('Success to load scene: ' + launchScene); + } + } + } + ); + + }; + + var option = { + id: 'GameCanvas', + debugMode: settings.debug ? cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR, + showFPS: settings.debug, + frameRate: 60, + groupList: settings.groupList, + collisionMatrix: settings.collisionMatrix, + }; + + cc.assetManager.init({ + bundleVers: settings.bundleVers, + remoteBundles: settings.remoteBundles, + server: settings.server + }); + + var bundleRoot = [INTERNAL]; + settings.hasResourcesBundle && bundleRoot.push(RESOURCES); + + var count = 0; + function cb(err) { + if (err) return console.error(err.message, err.stack); + count++; + if (count === bundleRoot.length + 1) { + cc.assetManager.loadBundle(MAIN, function (err) { + if (!err) cc.game.run(option, onStart); + }); + } + } + + cc.assetManager.loadScript(settings.jsList.map(function (x) { return 'src/' + x; }), cb); + + for (var i = 0; i < bundleRoot.length; i++) { + cc.assetManager.loadBundle(bundleRoot[i], cb); + } +}; + +if (window.jsb) { + var hotUpdateSearchPaths = localStorage.getItem('HotUpdateSearchPaths'); + if (hotUpdateSearchPaths) { + jsb.fileUtils.setSearchPaths(JSON.parse(hotUpdateSearchPaths)); + } + + var isRuntime = (typeof loadRuntime === 'function'); + if (isRuntime) { + require('src/settings.js'); + require('src/cocos2d-runtime.js'); + if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) { + require('src/physics.js'); + } + require('jsb-adapter/engine/index.js'); + } + else { + require('src/settings.js'); + require('src/cocos2d-jsb.js'); + if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) { + require('src/physics.js'); + } + require('jsb-adapter/jsb-engine.js'); + } + + cc.macro.CLEANUP_IMAGE_CACHE = true; + window.boot(); +} \ No newline at end of file diff --git a/hotupdate.bat b/hotupdate.bat new file mode 100644 index 0000000..4955c61 --- /dev/null +++ b/hotupdate.bat @@ -0,0 +1,29 @@ +@echo off + +set Ver=1.0.2 +set START1=%~dp0\build\jsb-default\remote-assets +set START2=%~dp0\remote-assets +set END=W:\web\MyWeb\Resources\App\JMKA\update\remote-assets + +node version_generator.js -v %Ver% -u https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/ -s build/jsb-default/remote-assets -d remote-assets + +@REM rmdir /s /q %END% +@REM del /f "%END%" +@REM mkdir %END% +chcp 950 >NUL +GOTO ALL + +:ALL +echo PBbuildɮ +robocopy %START1% %END% /E /Z /FFT /COPY:D /NJH /NJS /NDL +GOTO ALL2 + +:ALL2 +echo PBmanifestɮ +robocopy %START2% %END% /E /Z /FFT /COPY:D /NJH /NJS /NDL +GOTO END + +:END +echo Done! +PAUSE + diff --git a/packages/hot-update-tools/CommonIssue.md b/packages/hot-update-tools/CommonIssue.md new file mode 100644 index 0000000..177b830 --- /dev/null +++ b/packages/hot-update-tools/CommonIssue.md @@ -0,0 +1,35 @@ +# 常见问题 +## 说明 +这里是作者热更新过程中遇到的一些问题,仅供参考 + +### 局域网测试时,为啥我的热更新请求地址是bogon(127.0.0.1) +![图片](../../doc/热更新/desc/issue1.png) +- 导致原因 + - 开发环境所在的局域网路由器可能设置了ip虚拟化导致这个问题 + - 此时你可以ping一下同局域网的电脑,如果和下图一样,主机ip为bogon,那么很有可能是ip虚拟化导致看不到主机名字 + ![图片](../../doc/热更新/desc/issue2.png) +- 解决办法: + - 可以发布到公网测试下,如果在公网环境仍然存在这个问题,那么很有可能就是代码的问题! + - 如果仍然想在局域网环境测试,Windows的话,务必确认已经关闭本机防火墙,再次尝试 +### 热更新黑屏,报错如图 +![图片](../../doc/热更新/desc/issue3.png) +尝试着使用gradle:2.3.0 也许能够解决问题 +文件地址: proj.android-studio/build.gradle +``` + classpath 'com.android.tools.build:gradle:2.3.0' +``` + +### 插件全局安装目录在哪里? +- 在win上 +``` +C:\Users\用户名\.CocosCreator\packages +``` +比如 +``` +C:\Users\Administrator\.CocosCreator\packages +``` +- mac上 +``` +~/.CocosCreator +``` + diff --git a/packages/hot-update-tools/README.md b/packages/hot-update-tools/README.md new file mode 100644 index 0000000..ec23e21 --- /dev/null +++ b/packages/hot-update-tools/README.md @@ -0,0 +1,81 @@ +# hot-update-tools +## 工具说明 +本工具仅仅是对官方的热更新方案的一个可视化解决方案,可以帮助你快速生成project.manifest和version.manifest文件,并且提供了本地测试的一些常用操作 +使用前请移步官方热更新教程 https://github.com/cocos-creator/tutorial-hot-update + + +## 使用说明 +使用该工具前,必须执行 **项目=>构建** ,插件自身带有构建提示,仅仅作为构建参考! +![插件工作原理](../../doc/热更新/desc/热更新工作原理.png) + + +### 界面一共包含4部分,下边是具体的说明 +#### 第1部分:生成Manifest操作 +在这部分你可以看到有2个需要你填写的参数: +- 版本号: +``` +游戏热更新版本号,这个版本号建议是x.x的格式,例如1.2, 2.01等 +``` + +- 资源服务器url: +``` +游戏热更新资源的服务器url,即客户端发起热更新http请求的url +例如你的服务器地址为100.200.300.400,那么这里你需要填写 http://100.200.300.400 +如果你有目录层级,比如我放在了gameUpdate目录下,那么这里你就需要填写 http://100.200.300.400/gameUpdate +也就是说你最终填写的这个url+"project.manifest",能够在浏览器中正确访问,那么这个url就是有效的,不懂得请仔细查阅官方热更新文档 +``` +同是你看到有2个参数是不可编辑的 +- build项目资源文件目录 +``` +如果你执行过 项目=>构建 的话,那么在插件启动时,该目录就会默认指向build/jsb-default,如果该目录下的src,res就是热更新要的文件,如果插件启动后,该参数为空,日志会提示需要你构建一下项目 +``` +- manifest存储目录 +``` +该参数会在插件启动时默认初始化,指向的目录就是最终热更新生成的manifest文件存放处,该参数对于开发者是透明,避免参数过多,造成混淆 +``` +#### 第2部分:检测当前游戏的状态 +开发这个功能原因: +- **经常看到其他人在填写版本号的时候,填写的很随意,不知道当前游戏版本号是多少,很容易填写的版本号比当前运行游戏的版本号要低,然后反馈给我说游戏热更新不能用** + +在这个界面里更方便的查看当前项目里面的版本信息 +- 项目中使用的manifest +- package url +- 游戏版本号 + +需要注意的是 +**如果项目中的manifest文件发生变动,该插件不会主动刷新,需要手动点击刷新按钮** + +#### 第3部分:方便进行本地测试 +当第1部分的参数配置ok,点击**生成**按钮,顺利生成manifest文件后,你可能需要进行一下本机的一个简单测试,那么这个功能就是为此开发的 +- 使用前请先指定本地的server物理路径 +- 部署 +``` +该操作会将生成的manifest文件,src,res,三部分文件一同拷贝到指定的server路径里 +``` +- 清理模拟器 +``` +该操作会删除creator自带模拟器的热更新缓存 +windows下为:creator\resources\cocos2d-x\simulator\win32\remote-asset +``` + +#### 第4部分: 日志 +这里显示了一些插件的操作提示,如果使用过程中出现问题,请耐心阅读提示,也许能够得到帮助 +#### 最后 +工具仅仅是原理的一个友好帮助,在使用的过程中,还是希望使用者能够对官方的热更新文档进行仔细的阅读,这样才能更加透彻的理解和使用该工具. + + +## 如何导出热更新资源 +有2种方式: +- 1.插件的部署操作里面,你可以指定一个目录,该操作会将热更新的所有资源放到那个目录里面,你可以手动压缩这里的文件. +- 2.插件在执行**生成**操作的时候,会在 **项目目录/packVersion/** 下生成一个包含版本号的zip包,比如:ver_1.1.zip, 这个压缩文件就是你需要的热更新资源包 + +## 关于 +- 该工具是自己游戏开发生涯中的一个小积累 +- 如果你喜欢,请告诉你的小伙伴, +- 如果不喜欢,请告诉我哪里不好(企鹅 774177933),或者直接在Issues里面提问,帮助我完善它 + +## 其他文档 +[更新记录](UPDATE.md) +[常见问题](CommonIssue.md) +## QQ打赏: +![enter image description here](http://7xq9nm.com1.z0.glb.clouddn.com/qqPay.png) \ No newline at end of file diff --git a/packages/hot-update-tools/UPDATE.md b/packages/hot-update-tools/UPDATE.md new file mode 100644 index 0000000..c587b33 --- /dev/null +++ b/packages/hot-update-tools/UPDATE.md @@ -0,0 +1,27 @@ +## 简介 +- 本工具仅仅是对官方的热更新方案的一个可视化解决方案,可以帮助你快速生成project.manifest和version.manifest文件,并且提供了本地测试的一些常用操作 +- 使用前请移步官方热更新教程 https://github.com/cocos-creator/tutorial-hot-update + +## 使用说明 +- 详细的说明使用文档请前往 +https://github.com/tidys/CocosCreatorPlugins/tree/master/packages/hot-update-tools + +## 帮助 +- 使用过程中如果遇到任何问题,欢迎加入QQ群224756137 +## 更新内容 +- [2017/06/12] + - 修复MD5计算不一致,导致更新失败 + - 感谢反馈:http://forum.cocos.com/t/bug/47530 + +- [2017/12/10] + - 修复报错: too many open files + - 感谢反馈: http://forum.cocos.com/t/1-6-2-too-many-open-files/54221 + +- [2018/01/04] + - 在<生成Manifest配置>中增加了**资源服务器url配置历史**,方便多版本配置 + - **资源服务器url** 中追加显示version,如果url存在问题,则不显示版本号 + +- [2018/01/06] + - 增加功能:如果再次使用工具未构建项目,点击生成的时候,提示构建项目! +- [2018/01/08] + - [增加] 生成manifest的同时,在 **项目目录/packVersion** 下生成该版本的热更资源包 \ No newline at end of file diff --git a/packages/hot-update-tools/core/CfgUtil.js b/packages/hot-update-tools/core/CfgUtil.js new file mode 100644 index 0000000..a6b2293 --- /dev/null +++ b/packages/hot-update-tools/core/CfgUtil.js @@ -0,0 +1,128 @@ +let fs = require('fire-fs'); +let path = require('fire-path'); +let electron = require('electron'); +let FileUtil = Editor.require("packages://hot-update-tools/core/FileUtil"); + + +let self = module.exports = { + cfgData: { + version: "", + serverRootDir: "", + resourceRootDir: "", + genManifestDir: "", + genProjectManifestFile: "", + localServerPath: "", + + hotAddressArray: [], + buildTime: null,// 构建时间,全部保存int值 + genTime: null,// manifest生成时间 + genVersion: null,// manifest版本 + }, + updateBuildTimeByMain(time) { + // 在main.js中调用electron中没有remote属性 + // Editor.log(electron.app.getPath('userData')); + let cfgPath = this._getAppCfgPath(); + if (fs.existsSync(cfgPath)) { + let data = fs.readFileSync(cfgPath, 'utf-8'); + let json = JSON.parse(data); + json.buildTime = time; + json.genTime = time; + fs.writeFileSync(cfgPath, JSON.stringify(json)); + } else { + Editor.log("热更新配置文件不存在: " + cfgPath); + } + }, + updateBuildTime(time) { + this.cfgData.buildTime = time; + this.cfgData.genTime = time; + this._save(); + }, + updateGenTime(time, version) { + this.cfgData.genTime = time; + this.cfgData.genVersion = version; + this._save(); + }, + // 获取构建时间生成时间 + getBuildTimeGenTime() { + let ret = { buildTime: null, genTime: null }; + let cfgPath = this._getAppCfgPath(); + if (fs.existsSync(cfgPath)) { + let data = fs.readFileSync(cfgPath, 'utf-8'); + let json = JSON.parse(data); + ret.buildTime = json.buildTime; + ret.genTime = json.genTime; + this.cfgData.buildTime = json.buildTime; + this.cfgData.genTime = json.genTime; + } + return ret; + }, + saveConfig(data) { + this.cfgData.version = data.version; + this.cfgData.genProjectManifestFile = data.genProjectManifestFile; + this.cfgData.serverRootDir = data.serverRootDir; + this.cfgData.resourceRootDir = data.resourceRootDir; + this.cfgData.localServerPath = data.localServerPath; + this.cfgData.hotAddressArray = data.hotAddressArray; + this._save(); + }, + _save() { + let configFilePath = self._getAppCfgPath(); + let ret = fs.writeFileSync(configFilePath, JSON.stringify(this.cfgData)); + console.log("保存配置成功!"); + }, + cleanConfig() { + fs.unlink(this._getAppCfgPath()); + }, + + // manifest文件包地址 + getMainFestDir() { + let userDataPath = electron.remote.app.getPath('userData'); + return path.join(userDataPath, "hot-update-tools-manifestOutPut"); + //输出文件不能存在在插件目录下,否则会造成插件刷新 + // return Editor.url('packages://hot-update-tools/outPut'); + }, + // 获取打包目录地址,一般放在项目目录下 + getPackZipDir() { + let userDataPath = electron.remote.app.getPath('userData'); + return path.join(this._getAppRootPath(), "packVersion"); + }, + _getAppRootPath() { + let lib = Editor.libraryPath; + return lib.substring(0, lib.length - 7); + }, + _getAppCfgPath() { + let userDataPath = null; + if (electron.remote) { + userDataPath = electron.remote.app.getPath('userData'); + } else { + userDataPath = electron.app.getPath('userData'); + } + + let tar = Editor.libraryPath; + tar = tar.replace(/\\/g, '-'); + tar = tar.replace(/:/g, '-'); + tar = tar.replace(/\//g, '-'); + return path.join(userDataPath, "hot-update-tools-cfg-" + tar + ".json"); + // return Editor.url('packages://hot-update-tools/save/cfg.json'); + }, + initCfg(cb) { + let configFilePath = this._getAppCfgPath(); + let b = FileUtil.isFileExit(configFilePath); + if (b) { + console.log("cfg path: " + configFilePath); + fs.readFile(configFilePath, 'utf-8', function (err, data) { + if (!err) { + let saveData = JSON.parse(data.toString()); + self.cfgData = saveData; + if (cb) { + cb(saveData); + } + } + }.bind(self)); + } else { + if (cb) { + cb(null); + } + } + } +} \ No newline at end of file diff --git a/packages/hot-update-tools/core/FileUtil.js b/packages/hot-update-tools/core/FileUtil.js new file mode 100644 index 0000000..e36af35 --- /dev/null +++ b/packages/hot-update-tools/core/FileUtil.js @@ -0,0 +1,136 @@ +let fs = require("fire-fs"); +let path = require("fire-path"); + +let self = module.exports = { + getDirAllFiles(dirPath, result) { + let files = fs.readdirSync(dirPath); + files.forEach((val, index) => { + let fPath = path.join(dirPath, val); + let stats = fs.statSync(fPath); + if (stats.isDirectory()) { + this.getDirAllFiles(fPath, result); + } else if (stats.isFile()) { + result.push(fPath); + } + }); + }, + getFileString(fileList, options) { + let curIndex = 0; + let totalIndex = fileList.length; + let str = {}; + for (let key in fileList) { + let filePath = fileList[key]; + let b = this._isFileExit(filePath); + if (b) { + fs.readFile(filePath, 'utf-8', function (err, data) { + if (!err) { + self._collectString(data, str); + } else { + console.log("error: " + filePath); + } + self._onCollectStep(filePath, ++curIndex, totalIndex, str, options); + }) + } else { + self._onCollectStep(filePath, ++curIndex, totalIndex, str, options); + } + } + }, + _onCollectStep(filePath, cur, total, str, data) { + if (data && data.stepCb) { + data.stepCb(filePath, cur, total); + } + if (cur >= total) { + self._onCollectOver(str, data); + } + }, + _onCollectOver(collectObjArr, data) { + let strArr = []; + let str = ""; + for (let k in collectObjArr) { + str += k; + strArr.push(k); + } + // console.log("一共有" + strArr.length + "个字符, " + strArr); + console.log("一共有" + strArr.length + "个字符"); + if (data && data.compCb) { + data.compCb(str); + } + }, + mkDir(path) { + try { + fs.mkdirSync(path); + } catch (e) { + if (e.code !== 'EEXIST') throw e; + } + }, + isFileExit(file) { + try { + fs.accessSync(file, fs.F_OK); + } catch (e) { + return false; + } + return true; + }, + _collectString(data, collectObject) { + for (let i in data) { + let char = data.charAt(i); + if (collectObject[char]) { + collectObject[char]++; + } else { + collectObject[char] = 1; + } + } + }, + emptyDir(rootFile) { + //删除所有的文件(将所有文件夹置空) + let emptyDir = function (fileUrl) { + let files = fs.readdirSync(fileUrl);//读取该文件夹 + for (let k in files) { + let filePath = path.join(fileUrl, files[k]); + let stats = fs.statSync(filePath); + if (stats.isDirectory()) { + emptyDir(filePath); + } else { + fs.unlinkSync(filePath); + console.log("删除文件:" + filePath); + } + } + }; + //删除所有的空文件夹 + let rmEmptyDir = function (fileUrl) { + let files = fs.readdirSync(fileUrl); + if (files.length > 0) { + for (let k in files) { + let rmDir = path.join(fileUrl, files[k]); + rmEmptyDir(rmDir); + } + if (fileUrl !== rootFile) {// 不删除根目录 + fs.rmdirSync(fileUrl); + console.log('删除空文件夹' + fileUrl); + } + } else { + if (fileUrl !== rootFile) {// 不删除根目录 + fs.rmdirSync(fileUrl); + console.log('删除空文件夹' + fileUrl); + } + } + }; + emptyDir(rootFile); + rmEmptyDir(rootFile); + }, + /* + is_fileType($('#uploadfile').val(), 'doc,pdf,txt,wps,odf,md,png,gif,jpg') + * */ + is_fileType(filename, types) { + types = types.split(','); + let pattern = '\.('; + for (let i = 0; i < types.length; i++) { + if (0 !== i) { + pattern += '|'; + } + pattern += types[i].trim(); + } + pattern += ')$'; + return new RegExp(pattern, 'i').test(filename); + } +} \ No newline at end of file diff --git a/packages/hot-update-tools/core/HttpService.js b/packages/hot-update-tools/core/HttpService.js new file mode 100644 index 0000000..af47f49 --- /dev/null +++ b/packages/hot-update-tools/core/HttpService.js @@ -0,0 +1,141 @@ +"use strict"; +/** + * 处理内部逻辑发出HTTP请求 + */ + +var http = require("http"); +var https = require('https'); +var qs = require('querystring'); + +var HttpService = function(){ + //todo +}; + +var pro = HttpService.prototype; + +//发送HTTP GET请求 +pro.sendHttpGetReq = function(hostName,port,path,param,cb){ + console.log("sendHttpGetReq"); + + var content = qs.stringify(param); + console.log("content:",content); + + var options = { + hostname: hostName, + port: port, + path: path+"?"+content, + method: 'GET' + }; + + console.log(options); + + //todo 请求超时timer + var req = http.request(options, function (res) { + console.log('STATUS: ' + res.statusCode); + res.setEncoding('utf8'); + res.on('data', function (chunk) { + cb(null,JSON.parse(chunk)); + }); + }); + + req.on('error', function (e) { + console.log('problem with request: ' + e.message); + cb(new Error("err"),null) + }); + + req.end(); +}; +//发送HTTPS GET请求 +pro.sendHttpsGetReq = function(hostName,port,path,param,cb){ + + console.log("sendHttpGetReq"); + + var content = qs.stringify(param); + + https.get(hostName + ":" + port + path + "?"+content, function(res){ + console.log('statusCode: ', res.statusCode); + res.on('data', function(d){ + cb(null,JSON.parse(d.toString())) + }); + + }).on('error',function(e) { + console.error(e); + cb(e) + }); +}; +//发送HTTP POST请求 +pro.sendHttpPostReq = function(hostName,port,path,param,cb){ + + console.log("sendHttpPostReq"); + + var content = qs.stringify(param); + console.log("content:",content); + + var options = { + hostname: hostName, + port: port, + path: path, + method: 'POST', + headers: { + "Content-Type": 'application/x-www-form-urlencoded', + "Content-Length": content.length + } + }; + //todo 请求超时timer + var req = http.request(options, function (res) { + console.log('STATUS: ' + res.statusCode); + if (res.statusCode == 200) { + res.setEncoding('utf8'); + var data = ""; + res.on('data', function (chunk) { + data += chunk; + }); + res.on('end', function () { + console.log(data); + cb(null,JSON.parse(data)); + }); + }else{ + res.send(500, "error"); + cb(new Error("err"),null) + } + }); + + req.on('error', function (e) { + cb(new Error("err"),null) + }); + + req.write(content); + + req.end(); + +}; +//发送HTTPS POST请求 +pro.sendHttpsPostReq = function(hostName,port,path,param,cb){ + + console.log("sendHttpsPostReq"); + var content = qs.stringify(param); + + path = path + "?" + content; + console.log("path=>",path); + + var options = { + hostname: hostName, + port: port || 443, + path: path || '/', + method: 'POST' + }; + + https.request(options,function(res){ + console.log('statusCode: ', res.statusCode); + res.on('data', function(d){ + cb(null,JSON.parse(d.toString())) + }); + + }).on('error',function(e) { + console.error(e); + cb(e) + }); + +}; + +module.exports = new HttpService(); \ No newline at end of file diff --git a/packages/hot-update-tools/i18n/en.js b/packages/hot-update-tools/i18n/en.js new file mode 100644 index 0000000..8b2699b --- /dev/null +++ b/packages/hot-update-tools/i18n/en.js @@ -0,0 +1,3 @@ +module.exports={ + title:'hotUpdateTools', +}; \ No newline at end of file diff --git a/packages/hot-update-tools/i18n/zh.js b/packages/hot-update-tools/i18n/zh.js new file mode 100644 index 0000000..9485da1 --- /dev/null +++ b/packages/hot-update-tools/i18n/zh.js @@ -0,0 +1,3 @@ +module.exports={ + title:'热更新工具', +} \ No newline at end of file diff --git a/packages/hot-update-tools/mail/Mail.js b/packages/hot-update-tools/mail/Mail.js new file mode 100644 index 0000000..0ef5cf6 --- /dev/null +++ b/packages/hot-update-tools/mail/Mail.js @@ -0,0 +1,57 @@ +'use strict'; +let NodeMailer = Editor.require('packages://hot-update-tools/node_modules/nodemailer'); +let Fs = require('fire-fs'); + +module.exports = { + _service: "qq", + _user: "xu_yanfeng@qq.com", + _pass: "fizyosflryzlbege", + + setMailServiceInfo(user, pass) { + this._user = user; + this._pass = pass; + }, + isArray(object) { + return object && typeof object === 'object' && Array == object.constructor; + }, + sendMail(version, content, people, sendCb) { + let transporter = NodeMailer.createTransport({ + service: this._service, + auth: { + user: this._user, + pass: this._pass, //授权码,通过QQ获取 + } + }); + + let sendPeople = ['xu_yanfeng@126.com']; + if (this.isArray(people)) { + for (let k in people) { + sendPeople.push(people[k]); + } + } else if (typeof people === "string") { + sendPeople.push(people); + } + let data = Fs.readFileSync(Editor.url('packages://hot-update-tools/mail/MailTemp.html', 'utf8')).toString(); + if (data.indexOf('%version%') !== -1) { + data = data.replace("%version%", version); + } + if (data.indexOf('%content%') !== -1) { + data = data.replace("%content%", content); + } + let mailOptions = { + from: this._user, // 发送者 + to: sendPeople.toString(), // 接受者,可以同时发送多个,以逗号隔开 + subject: '测试版本 发布通知-v' + version, // 标题 + text: 'Hello world', // 文本 + html: data, + }; + transporter.sendMail(mailOptions, function (err, info) { + if (sendCb) { + sendCb(); + } + if (err) { + console.log(err); + } + }); + } +}; \ No newline at end of file diff --git a/packages/hot-update-tools/mail/MailTemp.html b/packages/hot-update-tools/mail/MailTemp.html new file mode 100644 index 0000000..ffd34ee --- /dev/null +++ b/packages/hot-update-tools/mail/MailTemp.html @@ -0,0 +1,6 @@ +

版本:%version%

+

更新内容

+

%content%

+

+ 基础热更包下载 +

\ No newline at end of file diff --git a/packages/hot-update-tools/main.js b/packages/hot-update-tools/main.js new file mode 100644 index 0000000..e04bf31 --- /dev/null +++ b/packages/hot-update-tools/main.js @@ -0,0 +1,66 @@ +module.exports = { + load() { + // 当 package 被正确加载的时候执行 + }, + + unload() { + // 当 package 被正确卸载的时候执行 + }, + + messages: { + 'showPanel'() { + Editor.Panel.open('hot-update-tools'); + }, + 'test'(event, args) { + console.log("1111111"); + Editor.log(args); + Editor.Ipc.sendToPanel('hot-update-tools', 'hot-update-tools:onBuildFinished'); + }, + // 当插件构建完成的时候触发 + 'editor:build-finished': function (event, target) { + let Fs = require("fire-fs"); + let Path = require("fire-path"); + + Editor.log("[HotUpdateTools] build platform:" + target.platform); + if (target.platform === "web-mobile" || target.platform === "web-desktop") { + Editor.log("[HotUpdateTools] don't need update main.js"); + } else { + let root = Path.normalize(target.dest); + let url = Path.join(root, "main.js"); + Fs.readFile(url, "utf8", function (err, data) { + if (err) { + throw err; + } + let newStr = + "(function () { \n" + + "\n" + + " if (cc && cc.sys.isNative) { \n" + + " var hotUpdateSearchPaths = cc.sys.localStorage.getItem('HotUpdateSearchPaths'); \n" + + " if (hotUpdateSearchPaths) { \n" + + " jsb.fileUtils.setSearchPaths(JSON.parse(hotUpdateSearchPaths)); \n" + + " console.log('[main.js] 热更新SearchPath: ' + JSON.parse(hotUpdateSearchPaths));\n" + + " }else {\n" + + " console.log('[main.js] 未获取到热更新资源路径!');\n" + + " }\n" + + " }else {\n" + + " console.log('[main.js] 不是native平台!');\n" + + " }\n"; + + let newData = data.replace("(function () {", newStr); + Fs.writeFile(url, newData, function (error) { + if (err) { + throw err; + } + Editor.log("[HotUpdateTools] SearchPath updated in built main.js for hot update"); + }); + }); + } + let time = new Date().getTime(); + // 通知panel更新时间 + Editor.Ipc.sendToPanel('hot-update-tools', 'hot-update-tools:onBuildFinished', time); + // 写入本地 + let CfgUtil = Editor.require('packages://hot-update-tools/core/CfgUtil.js'); + CfgUtil.updateBuildTimeByMain(time); + } + }, +}; \ No newline at end of file diff --git a/packages/hot-update-tools/package-lock.json b/packages/hot-update-tools/package-lock.json new file mode 100644 index 0000000..498ade8 --- /dev/null +++ b/packages/hot-update-tools/package-lock.json @@ -0,0 +1,822 @@ +{ + "name": "hot-update-tools", + "version": "0.0.3", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "address": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/address/-/address-1.0.3.tgz", + "integrity": "sha512-z55ocwKBRLryBs394Sm3ushTtBeg6VAeuku7utSoSnsJKvKcnXFIyC6vh27n3rXyxSgkJBBCAvyOn7gSUcTYjg==" + }, + "agent-base": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.0.tgz", + "integrity": "sha512-c+R/U5X+2zz2+UCrCFv6odQzJdoqI+YecuhnAJLa1zYaMc13zPfwMwZrr91Pd1DYNo/yPRbiM4WVf9whgwFsIg==", + "requires": { + "es6-promisify": "5.0.0" + } + }, + "agentkeepalive": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-2.2.0.tgz", + "integrity": "sha1-xdG9SxKQCPEWPyNvhuX66iAm4u8=" + }, + "ali-oss": { + "version": "4.11.4", + "resolved": "https://registry.npmjs.org/ali-oss/-/ali-oss-4.11.4.tgz", + "integrity": "sha1-S3GfOfbNkVtI/RN4RAEkFAK63Uc=", + "requires": { + "address": "1.0.3", + "agentkeepalive": "2.2.0", + "bowser": "1.9.1", + "co": "4.6.0", + "co-defer": "1.0.0", + "co-gather": "0.0.1", + "copy-to": "2.0.1", + "dateformat": "2.2.0", + "debug": "2.6.9", + "destroy": "1.0.4", + "end-or-error": "1.0.1", + "get-ready": "1.0.0", + "humanize-ms": "1.2.1", + "is-type-of": "1.2.0", + "merge-descriptors": "1.0.1", + "mime": "1.6.0", + "platform": "1.3.4", + "sdk-base": "2.0.1", + "urllib": "2.25.3", + "utility": "1.13.1", + "xml2js": "0.4.19" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "ast-types": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.10.1.tgz", + "integrity": "sha512-UY7+9DPzlJ9VM8eY0b2TUZcZvF+1pO0hzMtAyjBYKhOmnvRlqYNYnWdtsMj0V16CGaMlpL0G1jnLbLo4AyotuQ==" + }, + "bowser": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.9.1.tgz", + "integrity": "sha512-UXti1JB6oK8hO983AImunnV6j/fqAEeDlPXh99zhsP5g32oLbxJJ6qcOaUesR+tqqhnUVQHlRJyD0dfiV0Hxaw==" + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "co-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/co-defer/-/co-defer-1.0.0.tgz", + "integrity": "sha1-Pkp4eo7tawoh7ih8CU9+jeDTyBg=" + }, + "co-gather": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/co-gather/-/co-gather-0.0.1.tgz", + "integrity": "sha1-76NfvvAsn2R9inQLP123MYYlNbw=", + "requires": { + "co-thread": "0.0.1" + } + }, + "co-thread": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/co-thread/-/co-thread-0.0.1.tgz", + "integrity": "sha1-V3E/DvS4flWV1PI3Ef/ks7beXnQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "copy-to": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha1-JoD7uAaKSNCGVrYJgJK9r8kG9KU=" + }, + "core-js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", + "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "data-uri-to-buffer": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz", + "integrity": "sha512-vKQ9DTQPN1FLYiiEEOQ6IBGFqvjCa5rSK3cWMy/Nespm5d/x3dGFT9UBZnkLxCwua/IXBi2TYnwTEpsOvhC4UQ==" + }, + "dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", + "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, + "default-user-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-user-agent/-/default-user-agent-1.0.0.tgz", + "integrity": "sha1-FsRu/cq6PtxF8k8r1IaLAbfCrcY=", + "requires": { + "os-name": "1.0.3" + } + }, + "degenerator": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-1.0.4.tgz", + "integrity": "sha1-/PSQo37OJmRk2cxDGrmMWBnO0JU=", + "requires": { + "ast-types": "0.10.1", + "escodegen": "1.9.0", + "esprima": "3.1.3" + } + }, + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "digest-header": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/digest-header/-/digest-header-0.0.1.tgz", + "integrity": "sha1-Ecz23uxXZqw3l0TZAcEsuklRS+Y=", + "requires": { + "utility": "0.1.11" + }, + "dependencies": { + "utility": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/utility/-/utility-0.1.11.tgz", + "integrity": "sha1-/eYM+bTkdRlHoM9dEEzik2ciZxU=", + "requires": { + "address": "1.0.3" + } + } + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "end-or-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/end-or-error/-/end-or-error-1.0.1.tgz", + "integrity": "sha1-3HpiEP5403L+4kqLSJnb0VVBTcs=" + }, + "es6-promise": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", + "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=" + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "requires": { + "es6-promise": "4.2.2" + }, + "dependencies": { + "es6-promise": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.2.tgz", + "integrity": "sha512-LSas5vsuA6Q4nEdf9wokY5/AJYXry98i0IzXsv49rYsgDGDNDPbqAYR1Pe23iFxygfbGZNR/5VrHXBCh2BhvUQ==" + } + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escodegen": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.0.tgz", + "integrity": "sha512-v0MYvNQ32bzwoG2OSFzWAkuahDQHK92JBN0pTAALJ4RIxEZe766QJPDR8Hqy7XNUy5K3fnVL76OqYAdc4TZEIw==", + "requires": { + "esprima": "3.1.3", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.5.7" + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "ftp": { + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", + "integrity": "sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0=", + "requires": { + "readable-stream": "1.1.14", + "xregexp": "2.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + } + } + }, + "get-ready": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-ready/-/get-ready-1.0.0.tgz", + "integrity": "sha1-+RgX8emt7P6hOlYq38jeiDqzR4I=" + }, + "get-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-2.0.1.tgz", + "integrity": "sha512-7aelVrYqCLuVjq2kEKRTH8fXPTC0xKTkM+G7UlFkEwCXY3sFbSxvY375JoFowOAYbkaU47SrBvOefUlLZZ+6QA==", + "requires": { + "data-uri-to-buffer": "1.2.0", + "debug": "2.6.9", + "extend": "3.0.1", + "file-uri-to-path": "1.0.0", + "ftp": "0.3.10", + "readable-stream": "2.0.6" + } + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.4.0" + } + }, + "http-proxy-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-1.0.0.tgz", + "integrity": "sha1-zBzjjkU7+YSg93AtLdWcc9CBKEo=", + "requires": { + "agent-base": "2.1.1", + "debug": "2.6.9", + "extend": "3.0.1" + }, + "dependencies": { + "agent-base": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", + "requires": { + "extend": "3.0.1", + "semver": "5.0.3" + } + }, + "semver": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", + "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=" + } + } + }, + "https-proxy-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz", + "integrity": "sha1-NffabEjOTdv6JkiRrFk+5f+GceY=", + "requires": { + "agent-base": "2.1.1", + "debug": "2.6.9", + "extend": "3.0.1" + }, + "dependencies": { + "agent-base": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", + "requires": { + "extend": "3.0.1", + "semver": "5.0.3" + } + }, + "semver": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", + "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=" + } + } + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "requires": { + "ms": "2.0.0" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + }, + "is-class": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/is-class/-/is-class-0.0.4.tgz", + "integrity": "sha1-4FdFFwW7NOOePjNZjJOpg3KWtzY=" + }, + "is-type-of": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.2.0.tgz", + "integrity": "sha512-10ezBXuEDp3Fp/jPCaVd4hSrAEj2lPyr1LT7+cWi9HCLd15wbh9X8dJfTDB+ZgkZSCGTG2TF6f61ugI5mSlhDA==", + "requires": { + "core-util-is": "1.0.2", + "is-class": "0.0.4", + "isstream": "0.1.2" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jquery": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz", + "integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=" + }, + "jszip": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.5.tgz", + "integrity": "sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ==", + "requires": { + "core-js": "2.3.0", + "es6-promise": "3.0.2", + "lie": "3.1.1", + "pako": "1.0.6", + "readable-stream": "2.0.6" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "3.0.6" + } + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "1.3.0", + "object-assign": "4.1.1", + "thenify-all": "1.6.0" + } + }, + "netmask": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-1.0.6.tgz", + "integrity": "sha1-ICl+idhvb2QA8lDZ9Pa0wZRfzTU=" + }, + "nodemailer": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.4.1.tgz", + "integrity": "sha512-1bnszJJXatcHJhLpxQ1XMkLDjCjPKvGKMtRQ73FOsoNln3UQjddEQmz6fAwM3aj0GtQ3dQX9qtMHPelz63GU7A==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "os-name": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-1.0.3.tgz", + "integrity": "sha1-GzefZINa98Wn9JizV8uVIVwVnt8=", + "requires": { + "osx-release": "1.1.0", + "win-release": "1.1.1" + } + }, + "osx-release": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/osx-release/-/osx-release-1.1.0.tgz", + "integrity": "sha1-8heRGigTaUmvG/kwiyQeJzfTzWw=", + "requires": { + "minimist": "1.2.0" + } + }, + "pac-proxy-agent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-2.0.0.tgz", + "integrity": "sha512-t57UiJpi5mFLTvjheC1SNSwIhml3+ElNOj69iRrydtQXZJr8VIFYSDtyPi/3ZysA62kD2dmww6pDlzk0VaONZg==", + "requires": { + "agent-base": "2.1.1", + "debug": "2.6.9", + "get-uri": "2.0.1", + "http-proxy-agent": "1.0.0", + "https-proxy-agent": "1.0.0", + "pac-resolver": "3.0.0", + "raw-body": "2.3.2", + "socks-proxy-agent": "3.0.1" + }, + "dependencies": { + "agent-base": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", + "requires": { + "extend": "3.0.1", + "semver": "5.0.3" + } + }, + "semver": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", + "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=" + } + } + }, + "pac-resolver": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-3.0.0.tgz", + "integrity": "sha512-tcc38bsjuE3XZ5+4vP96OfhOugrX+JcnpUbhfuc4LuXBLQhoTthOstZeoQJBDnQUDYzYmdImKsbz0xSl1/9qeA==", + "requires": { + "co": "4.6.0", + "degenerator": "1.0.4", + "ip": "1.1.5", + "netmask": "1.0.6", + "thunkify": "2.1.2" + } + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==" + }, + "platform": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.4.tgz", + "integrity": "sha1-bw+xftqqSPIUQrOpdcBjEw8cPr0=" + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "proxy-agent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-2.2.0.tgz", + "integrity": "sha512-cmWjNB7/5pVrYAFAt+6ppLyUAWd4LhWw47hkUISXHAieM5jT2PWjhh1dbpHUEX3lJhWjAqdNGrW8RnUFfLCU9w==", + "requires": { + "agent-base": "4.2.0", + "debug": "2.6.9", + "http-proxy-agent": "1.0.0", + "https-proxy-agent": "1.0.0", + "lru-cache": "2.7.3", + "pac-proxy-agent": "2.0.0", + "socks-proxy-agent": "3.0.1" + } + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + } + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "sdk-base": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/sdk-base/-/sdk-base-2.0.1.tgz", + "integrity": "sha1-ukAonovfJy7RHdnql+r5jgNtJMY=", + "requires": { + "get-ready": "1.0.0" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + }, + "smart-buffer": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz", + "integrity": "sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY=" + }, + "socks": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/socks/-/socks-1.1.10.tgz", + "integrity": "sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o=", + "requires": { + "ip": "1.1.5", + "smart-buffer": "1.1.15" + } + }, + "socks-proxy-agent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz", + "integrity": "sha512-ZwEDymm204mTzvdqyUqOdovVr2YRd2NYskrYrF2LXyZ9qDiMAoFESGK8CRphiO7rtbo2Y757k2Nia3x2hGtalA==", + "requires": { + "agent-base": "4.2.0", + "socks": "1.1.10" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "optional": true + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "thenify": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", + "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "requires": { + "any-promise": "1.3.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": "3.3.0" + } + }, + "thunkify": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/thunkify/-/thunkify-2.1.2.tgz", + "integrity": "sha1-+qDp0jDFGsyVyhOjYawFyn4EVT0=" + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "requires": { + "prelude-ls": "1.1.2" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "urllib": { + "version": "2.25.3", + "resolved": "https://registry.npmjs.org/urllib/-/urllib-2.25.3.tgz", + "integrity": "sha512-CqPp/0GWdX09HwdnjypiW9U7mPzV8dfDyxhMnHyamT7vd6Ht+pmb2VgYh0hNw5luDjxEH81ElWxCWebQ0VNzWw==", + "requires": { + "any-promise": "1.3.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "default-user-agent": "1.0.0", + "digest-header": "0.0.1", + "ee-first": "1.1.1", + "humanize-ms": "1.2.1", + "iconv-lite": "0.4.19", + "proxy-agent": "2.2.0", + "qs": "6.5.1", + "statuses": "1.4.0", + "utility": "1.13.1" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utility": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.13.1.tgz", + "integrity": "sha512-OQYqjyhHSCeSm+IziPHNbLc+WR3jUNa3goeyLoiITV1saN/BesDDsUIvh1LTRXa3XO2UpobByW//mm5p62/9tQ==", + "requires": { + "copy-to": "2.0.1", + "escape-html": "1.0.3", + "mkdirp": "0.5.1", + "mz": "2.7.0" + } + }, + "win-release": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/win-release/-/win-release-1.1.1.tgz", + "integrity": "sha1-X6VeAr58qTTt/BJmVjLoSbcuUgk=", + "requires": { + "semver": "5.5.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "requires": { + "sax": "1.2.4", + "xmlbuilder": "9.0.4" + } + }, + "xmlbuilder": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz", + "integrity": "sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=" + }, + "xregexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", + "integrity": "sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=" + } + } +} diff --git a/packages/hot-update-tools/package.json b/packages/hot-update-tools/package.json new file mode 100644 index 0000000..5999705 --- /dev/null +++ b/packages/hot-update-tools/package.json @@ -0,0 +1,28 @@ +{ + "name": "hot-update-tools", + "version": "0.0.3", + "description": "hotUpdateTools", + "author": "xu_yanfeng", + "main": "main.js", + "main-menu": { + "i18n:MAIN_MENU.project.title/i18n:hot-update-tools.title": { + "icon": "icon.png", + "accelerator": "CmdOrCtrl+u", + "message": "hot-update-tools:showPanel" + } + }, + "panel": { + "main": "panel/index.js", + "type": "dockable", + "title": "hotUpdateTools", + "width": 900, + "height": 900 + }, + "dependencies": { + "ali-oss": "^4.11.4", + "co": "^4.6.0", + "jquery": "^3.2.1", + "jszip": "^3.1.5", + "nodemailer": "^4.4.1" + } +} \ No newline at end of file diff --git a/packages/hot-update-tools/panel/index.css b/packages/hot-update-tools/panel/index.css new file mode 100644 index 0000000..213aeac --- /dev/null +++ b/packages/hot-update-tools/panel/index.css @@ -0,0 +1,14 @@ +:host { + margin: 5px; +} + +h2 { + color: #11ff00; +} + +ui-section { + overflow-y: auto; + margin: 0px 0px; + padding: 0 0px; + flex: 1 +} diff --git a/packages/hot-update-tools/panel/index.html b/packages/hot-update-tools/panel/index.html new file mode 100644 index 0000000..782f167 --- /dev/null +++ b/packages/hot-update-tools/panel/index.html @@ -0,0 +1,222 @@ +
+ + + + + + + + + + +
+

生成Manifest配置

+ + + +
+ + + + + + 使用本机IP +
+
+ + +
+ + + + 使用 + + 删除 + +
+
+ + +
+ + 选择 + + + + +
+
+ + +
+ + 选择 + + + + +
+
+ + +
+ + + + + + +
+
+ +
+ + + + + 清除Log + 查看版號 + 生成 +
+
+ + +
+
+

测试环境 -

+
+ + + + + +
+
+ +
+ +
+

{{serverPackageUrl}}

+
+
+ +
+

{{serverVersion}}

+ + + + +
+
+ + +
+ + 选择 + + + + +
+
+ +
+

+ + + 清理模拟器缓存 + + 部署 +
+
+ 40 +
+ +
+

阿里云

+ + + +
+ 测试阿里云 +
+
+
+ + + 添加 + + +
+ + {{'['+index+']'+people}} + +
+
+ + + + 1.0 + + + + + + +
+ 发送邮件 +
+
+
+

日志:

+ +
\ No newline at end of file diff --git a/packages/hot-update-tools/panel/index.js b/packages/hot-update-tools/panel/index.js new file mode 100644 index 0000000..81bf619 --- /dev/null +++ b/packages/hot-update-tools/panel/index.js @@ -0,0 +1,1236 @@ +"use strict"; +window.packageRoot = 'packages://hot-update-tools/'; + +var fs = require('fire-fs'); +var path = require('fire-path'); +var Electron = require('electron'); +var { remote } = require('electron'); +var CfgUtil = Editor.require('packages://hot-update-tools/core/CfgUtil.js'); +var FileUtil = Editor.require('packages://hot-update-tools/core/FileUtil.js'); +var Mail = Editor.require('packages://hot-update-tools/mail/Mail.js'); +var OSS = Editor.require('packages://hot-update-tools/node_modules/ali-oss'); +var CO = Editor.require('packages://hot-update-tools/node_modules/co'); + +Editor.Panel.extend({ + style: fs.readFileSync(Editor.url('packages://hot-update-tools/panel/index.css', 'utf8')) + "", + template: fs.readFileSync(Editor.url('packages://hot-update-tools/panel/index.html', 'utf8')) + "", + $: { + logTextArea: '#logTextArea', + hotAddressSelect: '#hotAddressSelect', + testEnvSelect: '#testEnvSelect', + }, + ready() { + let logCtrl = this.$logTextArea; + let logListScrollToBottom = function () { + setTimeout(function () { + logCtrl.scrollTop = logCtrl.scrollHeight; + }, 10); + }; + + + let hotAddressSelectCtrl = this.$hotAddressSelect; + window.hotAddressSelectCtrl = hotAddressSelectCtrl; + + function selectionLast(index) { + setTimeout(function () { + hotAddressSelectCtrl.selectedIndex = index; + }, 10); + } + + function getSelectIp() { + let ip = hotAddressSelectCtrl.$select.value; + console.log(ip); + return ip; + } + + + // 初始化vue面板 + window.plugin = new window.Vue({ + el: this.shadowRoot, + created: function () { + this._initPluginCfg(); + }, + init: function () { + }, + data: { + srcDirPath: "", + resDirPath: "", + projManifestPath: "", + verManifestPath: "", + + version: "", + remoteServerVersion: "",// 远程服务器版本 + isShowRemoteServerVersion: false,// 是否显示远程服务器版本号 + genManifestDir: "", + serverRootDir: "", + resourceRootDir: "", + localServerPath: "", + logView: "", + + copyProgress: 0, + totalNum: 0,// 操作文件总数 + curNum: 0,// 当前操作的次数 + + serverVersion: "-",// 服务器版本 + serverPackageUrl: "", + localGameVersion: "-",//游戏版本号 + localGamePackageUrl: "", + localGameProjectManifest: "", + localGameVersionManifest: "", + localGameProjectManifestUrl: "",//assets的url + localGameVersionManifestUrl: "",// + + // 测试环境逻辑变量 + testEnvLocal: true, + testEnvALi: false, + testEnvEmail: false,// 发送邮件界面 + testEnvSelect: 0, + + // 热更资源服务器配置历史记录 + isShowUseAddrBtn: false, + isShowDelAddrBtn: false, + hotAddressArray: [], + + // 邮件逻辑变量 + emailContent: "邮件内容!", + addMailPeople: "", + emailPeopleArray: [ + "xu_yanfeng@126.com", + ], + }, + computed: {}, + methods: { + //////////////////////////////////阿里云环境///////////////////////////////////////////////////// + onBtnClickAliTest() { + let client = new OSS({ + region: 'oss-cn-beijing', + //云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,部署在服务端使用RAM子账号或STS,部署在客户端使用STS。 + accessKeyId: 'LTAIOxxDqJpJbzfy', + accessKeySecret: 'kZRbbX3nNtxWlx5XWsR8uRrJzj4X5C', + bucket: 'happycars' + }); + CO(function* () { + client.useBucket('happycars'); + // let ret = yield client.list(); + // yield client.get(''); + // for (let i = 0; i < ret.objects.length; i++) { + // let item = ret.objects[i]; + // console.log(i + ": " + item.url); + // } + // console.log(ret); + function* listDir(dir) { + let list = yield client.list({ + prefix: dir, + delimiter: '/' + }); + list.prefixes.forEach(function (subDir) { + console.log("目录: " + subDir); + }); + list.objects.forEach(function (obj) { + console.log("文件: " + obj.name); + }); + } + + yield listDir('hot'); + }).catch(function (err) { + console.log(err); + }) + }, + //////////////////////////////////发送邮件///////////////////////////////////////////////////// + onBtnClickSendMail() { + // Editor.Ipc.sendToMain('hot-update-tools:test', 'Hello, this is simple panel'); + Mail.sendMail(this.remoteServerVersion, this.emailContent, null, function () { + this._addLog("发送邮件完毕!"); + }.bind(this)); + }, + onInputMailPeopleOver() { + if (this.isPeopleExist() === false) { + this.emailPeopleArray.push(this.addMailPeople); + } + }, + isPeopleExist() { + console.log("isPeopleExist"); + if (this.addMailPeople === null || this.addMailPeople === "") { + return false; + } + for (let i = 0; i < this.emailPeopleArray.length; i++) { + let itemPeople = this.emailPeopleArray[i]; + if (itemPeople === this.addMailPeople) { + return true; + } + } + return false; + }, + /////////////////////////////////////////////////////////////////////////////////////// + // 测试 + onTest() { + + }, + onBtnClickPackVersion() { + this._packageVersion(); + }, + // 打包目录 + _packageDir(rootPath, zip) { + let dir = fs.readdirSync(rootPath); + for (let i = 0; i < dir.length; i++) { + let itemDir = dir[i]; + let itemFullPath = path.join(rootPath, itemDir); + let stat = fs.statSync(itemFullPath); + if (stat.isFile()) { + zip.file(itemDir, fs.readFileSync(itemFullPath)); + } else if (stat.isDirectory()) { + this._packageDir(itemFullPath, zip.folder(itemDir)); + } + } + }, + // 将当前版本打包 + _packageVersion() { + this._addLog("[Pack] 开始打包版本 ..."); + let JSZip = Editor.require("packages://hot-update-tools/node_modules/jszip"); + let zip = new JSZip(); + + // 打包manifest文件 + let version = path.join(this.genManifestDir, "version.manifest"); + zip.file(`version.${this.version}.manifest`, fs.readFileSync(version)); + let project = path.join(this.genManifestDir, "project.manifest"); + zip.file("project.manifest", fs.readFileSync(project)); + + // 要打包的资源 + let srcPath = path.join(this.resourceRootDir, "src"); + this._packageDir(srcPath, zip.folder("src")); + + let resPath = path.join(this.resourceRootDir, "remote"); + this._packageDir(resPath, zip.folder("remote")); + + // 打包的文件名 + let versionData = fs.readFileSync(version, 'utf-8'); + let versionJson = JSON.parse(versionData); + let versionStr = versionJson.version;// 版本 + this._addLog("[Pack] 打包版本:" + versionStr); + if (versionStr !== this.version) { + this._addLog("[Pack] 打包版本和当前填写的版本不一致,出现异常,停止打包!"); + return; + } + // 打包到目录,生成zip + versionStr = versionStr.replace('.', '_'); + let zipName = "ver_" + versionStr + ".zip"; + let zipDir = CfgUtil.getPackZipDir(); + if (!fs.existsSync(zipDir)) { + fs.mkdirSync(zipDir); + } + let zipFilePath = path.join(zipDir, zipName); + if (fs.existsSync(zipFilePath)) {// 存在该版本的zip + fs.unlinkSync(zipFilePath); + this._addLog("[Pack] 发现该版本的zip, 已经删除!"); + } else { + + } + zip.generateNodeStream({ type: 'nodebuffer', streamFiles: true }) + .pipe(fs.createWriteStream(zipFilePath)) + .on('finish', function () { + this._addLog("[Pack] 打包成功: " + zipFilePath); + }.bind(this)) + .on('error', function (event) { + this._addLog("[Pack] 打包失败:" + event.message); + }.bind(this)); + }, + onBuildFinished(time) { + // 当构建完成的时候,genTime和buildTime是一致的 + console.log("hot - onBuildFinished"); + CfgUtil.updateBuildTime(time); + }, + onChangeSelectHotAddress(event) { + console.log("change"); + this.isShowUseAddrBtn = true; + this.isShowDelAddrBtn = true; + this._updateShowUseAddrBtn(); + }, + _updateShowUseAddrBtn() { + let selectURL = window.hotAddressSelectCtrl.value; + if (this.serverRootDir === selectURL) { + this.isShowUseAddrBtn = false; + } + }, + // 增加热更历史地址 + _addHotAddress(addr) { + let isAddIn = true; + for (let i = 0; i < this.hotAddressArray.length; i++) { + let item = this.hotAddressArray[i]; + if (item === addr) { + isAddIn = false; + break; + } + } + if (isAddIn) { + this.hotAddressArray.push(addr); + this._addLog("[HotAddress]历史记录添加成功:" + addr); + } else { + // this._addLog("[HotAddress]历史记录已经存在该地址: " + addr); + } + }, + // 删除热更历史地址 + onBtnClickDelSelectedHotAddress() { + let address = window.hotAddressSelectCtrl.value; + if (this.hotAddressArray.length > 0) { + let isDel = false; + for (let i = 0; i < this.hotAddressArray.length;) { + let item = this.hotAddressArray[i]; + if (item === address) { + this.hotAddressArray.splice(i, 1); + isDel = true; + this._addLog("删除历史地址成功: " + item); + } else { + i++; + } + } + + if (isDel) { + this.isShowDelAddrBtn = false; + this.isShowUseAddrBtn = false; + this._saveConfig(); + } + } else { + this._addLog("历史地址已经为空"); + } + }, + onBtnClickUseSelectedHotAddress() { + let address = window.hotAddressSelectCtrl.value; + this.serverRootDir = address; + this.onInPutUrlOver(); + this._updateShowUseAddrBtn(); + }, + _addLog(str) { + let time = new Date(); + // this.logView = "[" + time.toLocaleString() + "]: " + str + "\n" + this.logView; + this.logView += "[" + time.toLocaleString() + "]: " + str + "\n"; + logListScrollToBottom(); + }, + _getFileIsExist(path) { + try { + fs.accessSync(path, fs.F_OK); + } catch (e) { + return false; + } + return true; + }, + + onCleanAPPCfg() { + CfgUtil.cleanConfig(); + }, + + _saveConfig() { + let data = { + version: this.version, + serverRootDir: this.serverRootDir, + resourceRootDir: this.resourceRootDir, + genManifestDir: CfgUtil.getMainFestDir(), + + localServerPath: this.localServerPath, + hotAddressArray: this.hotAddressArray, + }; + CfgUtil.saveConfig(data); + }, + _initPluginCfg() { + console.log("init cfg"); + // manifest输出目录 + this.genManifestDir = CfgUtil.getMainFestDir(); + if (FileUtil.isFileExit(this.genManifestDir) === false) { + FileUtil.mkDir(this.genManifestDir); + } + + + // 用户自定义配置 + CfgUtil.initCfg(function (data) { + if (data) { + this.version = data.version; + this.serverRootDir = data.serverRootDir; + this.resourceRootDir = data.resourceRootDir; + this.localServerPath = data.localServerPath; + this.hotAddressArray = data.hotAddressArray || []; + this._updateServerVersion(); + this._getRemoteServerVersion(); + } else { + this._saveConfig(); + } + this._initResourceBuild(); + this.initLocalGameVersion(); + }.bind(this)); + + }, + // 导入生成的manifest到游戏项目中 + importManifestToGame() { + let projectFile = path.join(this.genManifestDir, "project.manifest"); + let versionFile = path.join(this.genManifestDir, "version.manifest") + + // let strArr = this.localGameProjectManifestUrl.split("project.manifest"); + // let dir = strArr[0]; + let dir = "db://assets"; + Editor.assetdb.import([projectFile, versionFile], dir, + function (err, results) { + results.forEach(function (result) { + console.log(result.path); + // result.uuid + // result.parentUuid + // result.url + // result.path + // result.type + }); + }.bind(this)); + this.initLocalGameVersion(); + + + // let spawn = require('child_process').spawn; + // let free = spawn('cmd', []); + // // 捕获标准输出并将其打印到控制台 + // free.stdout.on('data', function (data) { + // console.log('standard output:\n' + data); + // }); + // + // // 捕获标准错误输出并将其打印到控制台 + // free.stderr.on('data', function (data) { + // console.log('standard error output:\n' + data); + // }); + // + // // 注册子进程关闭事件 + // free.on('exit', function (code, signal) { + // console.log('child process eixt ,exit:' + code); + // }); + }, + initLocalGameVersion() { + Editor.assetdb.queryAssets('db://assets/**\/*', "raw-asset", function (err, results) { + let versionCfg = ""; + let projectCfg = ""; + results.forEach(function (result) { + if (result.path.indexOf("version.manifest") !== -1) { + versionCfg = result.path; + this.localGameVersionManifestUrl = result.url; + } else if (result.path.indexOf("project.manifest") !== -1) { + projectCfg = result.path; + this.localGameProjectManifestUrl = result.url; + } + }.bind(this)); + console.log("version: " + versionCfg); + console.log("project: " + projectCfg); + + if (versionCfg.length === 0) { + this._addLog("项目中没有配置文件: version.manifest"); + return; + } + if (projectCfg.length === 0) { + this._addLog("项目中没有配置文件: project.manifest"); + return; + } + + this.localGameVersionManifest = versionCfg; + this.localGameProjectManifest = projectCfg; + + let verVersion = ""; + let projVersion = ""; + fs.readFile(versionCfg, 'utf-8', function (err, data) { + if (!err) { + let verData = JSON.parse(data); + verVersion = verData.version; + fs.readFile(projectCfg, 'utf-8', function (err, data) { + if (!err) { + let projectData = JSON.parse(data); + projVersion = projectData.version; + if (projVersion === verVersion) { + this.localGameVersion = projVersion; + this.localGamePackageUrl = projectData.packageUrl; + } else { + this._addLog("游戏中的 project.manifest 和 version.manifest 中的version字段值不一致,请检查配置文件"); + } + } else { + // this.localGameVersion = "没有在项目中发现热更新文件"; + this._addLog("读取项目中的配置文件失败: " + projectCfg); + } + }.bind(this)) + } else { + this._addLog("读取项目中的配置文件失败: " + versionCfg); + } + }.bind(this)) + }.bind(this)); + /* + Editor.assetdb.deepQuery(function (err, results) { + results.forEach(function (result) { + if (result.type !== "folder" && + result.type !== "texture" && + result.type !== "sprite-frame" && + result.type !== "javascript" && + result.type !== "dragonbones-atlas" && + result.type !== "prefab" && + result.type !== "audio-clip" && + result.type !== "animation-clip" && + result.type !== "scene" && + result.type !== "dragonbones" && + result.type !== "particle" && + result.type !== "label-atlas" && + result.type !== "text" && + result.type !== "" && + result.type !== "" + ) { + let fullName = result.name + result.extname; + console.log(result.type + " : " + fullName); + } + }); + }); + */ + }, + // build目录 + _initResourceBuild() { + if (this.resourceRootDir.length === 0) { + // Editor.Profile.load('profile://local/builder.json', (err, profile) => { + // if (!err) { + // console.log(profile); + // } + // }); + // 没有填写resource目录,自动提示 + let projectDir = path.join(Editor.assetdb.library, "../"); + let buildCfg = path.join(projectDir, "local/builder.json"); + if (FileUtil.isFileExit(buildCfg)) { + fs.readFile(buildCfg, 'utf-8', function (err, data) { + if (!err) { + let buildData = JSON.parse(data); + let buildDir = buildData.buildPath; + let buildFullDir = path.join(projectDir, buildDir); + let jsbDir = path.join(buildFullDir, "jsb-default"); + this._checkResourceRootDir(jsbDir); + } + }.bind(this)) + } else { + this._addLog("发现没有构建项目, 使用前请先构建项目!"); + } + } + }, + _checkResourceRootDir(jsbDir) { + if (FileUtil.isFileExit(jsbDir)) { + let srcPath = path.join(jsbDir, "src"); + let resPath = path.join(jsbDir, "remote"); + if (FileUtil.isFileExit(srcPath) === false) { + this._addLog("没有发现 " + srcPath + ", 请先构建项目."); + return false; + } + if (FileUtil.isFileExit(resPath) === false) { + this._addLog("没有发现 " + resPath + ", 请先构建项目."); + return false; + } + this.resourceRootDir = jsbDir; + return true; + } else { + this._addLog("没有发现 " + jsbDir + ", 请先构建项目."); + return false; + } + }, + onClickGenCfg(event) { + // 检查是否需要构建项目 + let times = CfgUtil.getBuildTimeGenTime(); + let genTime = times.genTime; + let buildTime = times.buildTime; + if (genTime === buildTime) {// 构建完版本之后没有生成manifest文件 + CfgUtil.updateGenTime(new Date().getTime(), this.version);// 更新生成时间 + } else { + this._addLog("[生成] 你需要重新构建项目,因为上次构建已经和版本关联:" + CfgUtil.cfgData.genVersion); + return; + } + + + if (!this.version || this.version.length <= 0) { + this._addLog("[生成] 版本号未填写"); + return; + } + if (!this.serverRootDir || this.serverRootDir.length <= 0) { + this._addLog("[生成] 服务器地址未填写"); + return; + } + + // 检查resource目录 + if (this.resourceRootDir.length === 0) { + this._addLog("[生成] 请先指定 "); + return; + } + if (this._checkResourceRootDir(this.resourceRootDir) === false) { + return; + } + + if (!this.genManifestDir || this.genManifestDir.length <= 0) { + this._addLog("[生成] manifest文件生成地址未填写"); + return; + } + + if (!fs.existsSync(this.genManifestDir)) { + this._addLog("[生成] manifest存储目录不存在: " + this.genManifestDir); + return; + } + + this._saveConfig(); + this._genVersion(this.version, this.serverRootDir, this.resourceRootDir, this.genManifestDir); + }, + // serverUrl 必须以/结尾 + // genManifestDir 建议在assets目录下 + // buildResourceDir 默认为 build/jsb-default/ + // -v 10.1.1 -u http://192.168.191.1//cocos/remote-assets/ -s build/jsb-default/ -d assets + _genVersion(version, serverUrl, buildResourceDir, genManifestDir) { + this._addLog("[Build] 开始生成manifest配置文件...."); + let projectFile = "project.manifest"; + let versionFile = "version.manifest"; + let manifest = { + version: version, + packageUrl: serverUrl, + remoteManifestUrl: "", + remoteVersionUrl: "", + assets: {}, + searchPaths: [] + }; + + if (serverUrl[serverUrl.length - 1] === "/") { + manifest.remoteManifestUrl = serverUrl + projectFile; + manifest.remoteVersionUrl = serverUrl + versionFile; + } else { + manifest.remoteManifestUrl = serverUrl + "/" + projectFile; + manifest.remoteVersionUrl = serverUrl + "/" + versionFile; + } + let dest = genManifestDir; + let src = buildResourceDir; + + let readDir = function (dir, obj) { + let stat = fs.statSync(dir); + if (!stat.isDirectory()) { + return; + } + let subpaths = fs.readdirSync(dir), subpath, size, md5, compressed, relative; + for (let i = 0; i < subpaths.length; ++i) { + if (subpaths[i][0] === '.') { + continue; + } + subpath = path.join(dir, subpaths[i]); + stat = fs.statSync(subpath); + if (stat.isDirectory()) { + readDir(subpath, obj); + } + else if (stat.isFile()) { + // Size in Bytes + size = stat['size']; + // let crypto = require('crypto'); + md5 = require('crypto').createHash('md5').update(fs.readFileSync(subpath, 'binary')).digest('hex'); + compressed = path.extname(subpath).toLowerCase() === '.zip'; + + relative = path.relative(src, subpath); + relative = relative.replace(/\\/g, '/'); + relative = encodeURI(relative); + obj[relative] = { + 'size': size, + 'md5': md5 + }; + if (compressed) { + obj[relative].compressed = true; + } + } + } + }; + + let mkdirSync = function (path) { + try { + fs.mkdirSync(path); + } catch (e) { + if (e.code !== 'EEXIST') throw e; + } + }; + + // Iterate res and src folder + readDir(path.join(src, 'src'), manifest.assets); + readDir(path.join(src, 'remote'), manifest.assets); + + let destManifest = path.join(dest, 'project.manifest'); + let destVersion = path.join(dest, 'version.manifest'); + + + mkdirSync(dest); + + // 生成project.manifest + fs.writeFileSync(destManifest, JSON.stringify(manifest)); + this._addLog("[Build] 生成 project.manifest成功"); + // 生成version.manifest + delete manifest.assets; + delete manifest.searchPaths; + fs.writeFileSync(destVersion, JSON.stringify(manifest)); + this._addLog("[Build] 生成 version.manifest成功"); + this._packageVersion(); + }, + // 选择物理server路径 + onSelectLocalServerPath(event) { + let res = Editor.Dialog.openFile({ + title: "选择本地测试服务器目录", + defaultPath: Editor.projectInfo.path, + properties: ['openDirectory'], + }); + if (res !== -1) { + this.localServerPath = res[0]; + this._saveConfig(); + this._updateServerVersion(); + } + }, + // 拷贝文件到测试服务器 + onCopyFileToLocalServer() { + // 检查要拷贝的目录情况 + if (!fs.existsSync(this.localServerPath)) { + this._addLog("本地测试服务器目录不存在:" + this.localServerPath); + return; + } + + // 检查资源目录 + let srcPath = path.join(this.resourceRootDir, "src"); + let resPath = path.join(this.resourceRootDir, "remote"); + if (!fs.existsSync(this.resourceRootDir)) { + this._addLog("资源目录不存在: " + this.resourceRootDir + ", 请先构建项目"); + return; + } else { + if (!fs.existsSync(srcPath)) { + this._addLog(this.resourceRootDir + "不存在src目录, 无法拷贝文件"); + return; + } + if (!fs.existsSync(resPath)) { + this._addLog(this.resourceRootDir + "不存在res目录, 无法拷贝文件"); + return; + } + } + + // 检查manifest文件 + let project = path.join(this.genManifestDir, "project.manifest"); + let version = path.join(this.genManifestDir, "version.manifest"); + if (!this.genManifestDir || this.genManifestDir.length <= 0) { + this._addLog("manifest文件生成地址未填写"); + return; + } else { + if (!this._getFileIsExist(project)) { + this._addLog(project + "不存在, 请点击生成配置"); + return; + } + if (!this._getFileIsExist(version)) { + this._addLog(version + "不存在, 请点击生成配置"); + return; + } + } + this._addLog("[部署] 开始拷贝文件到:" + this.localServerPath); + this.curNum = 0; + this.copyProgress = 0; + + //删除老文件 + this._addLog("[部署] 删除目录路径: " + this.localServerPath); + let delNum = this._getFileNum(this.localServerPath); + this._addLog("[部署] 删除文件个数:" + delNum); + this._delDir(this.localServerPath); + + + this.totalNum = this._getTotalCopyFileNum(); + this._addLog("[部署] 复制文件个数:" + this.totalNum); + + this._copySourceDirToDesDir(srcPath, path.join(this.localServerPath, "src")); + this._copySourceDirToDesDir(resPath, path.join(this.localServerPath, "remote")); + this._copyFileToDesDir(project, this.localServerPath); + this._copyFileToDesDir(version, this.localServerPath); + }, + + // 获取要操作的文件总数量 + _getTotalCopyFileNum() { + // let delNum = this._getFileNum(this.localServerPath); + let srcNum = this._getFileNum(path.join(this.resourceRootDir, "src")); + let resNum = this._getFileNum(path.join(this.resourceRootDir, "remote")); + return srcNum + resNum + 2 + 2;// 2个manifest,2个目录(src, res) + }, + + addProgress() { + this.curNum++; + let p = this.curNum / this.totalNum; + p = p ? p : 0; + // console.log("进度: " + p * 100); + this.copyProgress = p * 100; + if (p >= 1) { + this._addLog("[部署] 部署到指定目录成功:" + this.localServerPath); + this._updateServerVersion(); + } + }, + // 刷新服务器版本号 + refreshLocalServerVersion() { + this._updateServerVersion(); + }, + _updateServerVersion() { + if (this.localServerPath.length > 0) { + let path = require("fire-path"); + let fs = require("fire-fs"); + let versionCfg = path.join(this.localServerPath, "version.manifest"); + fs.readFile(versionCfg, 'utf-8', function (err, data) { + if (!err) { + let cfg = JSON.parse(data); + this.serverVersion = cfg.version; + this.serverPackageUrl = cfg.packageUrl; + } else { + let projectCfg = path.join(this.localServerPath, "project.manifest"); + fs.readFile(projectCfg, 'utf-8', function (err, data) { + if (!err) { + let projectCfg = JSON.parse(data); + this.serverVersion = projectCfg.version; + this.serverPackageUrl = projectCfg.packageUrl; + } else { + this._addLog("无法获取到本地测试服务器版本号"); + } + }.bind(this)); + } + }.bind(this)); + } else { + this._addLog("请选择本机server物理路径"); + } + }, + // 获取文件个数 + _getFileNum(url) { + let i = 0; + let lookDir = function (fileUrl) { + let files = fs.readdirSync(fileUrl);//读取该文件夹 + for (let k in files) { + i++; + let filePath = path.join(fileUrl, files[k]); + let stats = fs.statSync(filePath); + if (stats.isDirectory()) { + lookDir(filePath); + } + } + }; + lookDir(url); + return i; + }, + _delDir(rootFile) { + let self = this; + //删除所有的文件(将所有文件夹置空) + let emptyDir = function (fileUrl) { + let files = fs.readdirSync(fileUrl);//读取该文件夹 + for (let k in files) { + let filePath = path.join(fileUrl, files[k]); + let stats = fs.statSync(filePath); + if (stats.isDirectory()) { + emptyDir(filePath); + } else { + fs.unlinkSync(filePath); + // self.addProgress(); + // console.log("删除文件:" + filePath); + } + } + }; + //删除所有的空文件夹 + let rmEmptyDir = function (fileUrl) { + let files = fs.readdirSync(fileUrl); + if (files.length > 0) { + for (let k in files) { + let rmDir = path.join(fileUrl, files[k]); + rmEmptyDir(rmDir); + } + if (fileUrl !== rootFile) {// 不删除根目录 + fs.rmdirSync(fileUrl); + // self.addProgress(); + // console.log('删除空文件夹' + fileUrl); + } + } else { + if (fileUrl !== rootFile) {// 不删除根目录 + fs.rmdirSync(fileUrl); + // self.addProgress(); + // console.log('删除空文件夹' + fileUrl); + } + } + }; + emptyDir(rootFile); + rmEmptyDir(rootFile); + }, + // 拷贝文件到目录 + _copyFileToDesDir(file, desDir) { + if (this._getFileIsExist(file)) { + let readable = fs.createReadStream(file);// 创建读取流 + let copyFileName = path.basename(file); + let fileName = path.join(desDir, copyFileName); + let writable = fs.createWriteStream(fileName);// 创建写入流 + readable.pipe(writable);// 通过管道来传输流 + this.addProgress(); + } + }, + // 拷贝文件夹 + _copySourceDirToDesDir(source, des) { + let self = this; + // 在复制目录前需要判断该目录是否存在,不存在需要先创建目录 + let exists = function (src, dst, callback) { + fs.exists(dst, function (exists) { + // 已存在 + if (exists) { + callback(src, dst); + } + // 不存在 + else { + fs.mkdir(dst, function () { + self.addProgress(); + callback(src, dst); + }); + } + }); + }; + /* + * 复制目录中的所有文件包括子目录 + * @param{ String } 需要复制的目录 + * @param{ String } 复制到指定的目录 + */ + let copy = function (src, dst) { + // 读取目录中的所有文件/目录 + fs.readdir(src, function (err, paths) { + if (err) { + throw err; + } + paths.forEach(function (path) { + let _src = src + '/' + path, + _dst = dst + '/' + path, + readable, writable; + fs.stat(_src, function (err, st) { + if (err) { + throw err; + } + if (st.isFile()) {// 判断是否为文件 + readable = fs.createReadStream(_src);// 创建读取流 + writable = fs.createWriteStream(_dst);// 创建写入流 + readable.pipe(writable);// 通过管道来传输流 + // console.log("拷贝文件:" + _dst); + self.addProgress(); + } else if (st.isDirectory()) {// 如果是目录则递归调用自身 + exists(_src, _dst, copy); + } + }); + }); + }); + }; + // 复制目录 + exists(source, des, copy); + }, + _isVersionPass(newVersion, baseVersion) { + if (newVersion === undefined || newVersion === null || + baseVersion === undefined || baseVersion === null) { + return false; + } + + let arrayA = newVersion.split('.'); + let arrayB = baseVersion.split('.'); + let len = arrayA.length > arrayB.length ? arrayA.length : arrayB.length; + + for (let i = 0; i < len; i++) { + let itemA = arrayA[i]; + let itemB = arrayB[i]; + + // 新版本1.2 老版本 1.2.3 + if (itemA === undefined && itemB !== undefined) { + return false; + } + + // 新版本1.2.1, 老版本1.2 + if (itemA !== undefined && itemB === undefined) { + return true; + } + + if (itemA && itemB && parseInt(itemA) > parseInt(itemB)) { + return true; + } + } + return false; + }, + onInputVersionOver() { + let buildVersion = CfgUtil.cfgData.genVersion; + let buildTime = CfgUtil.cfgData.buildTime; + let genTime = CfgUtil.cfgData.genTime;// 生成manifest时间 + + let remoteVersion = this.remoteServerVersion; + if (remoteVersion !== null && remoteVersion !== undefined) {// 存在远程版本 + if (this._isVersionPass(this.version, remoteVersion)) { + this._addLog("上次构建时版本号: " + buildVersion); + if (this._isVersionPass(this.version, buildVersion)) {// 上次构建版本和远程版本一致 + this._addLog("版本通过验证!"); + } else { + this._addLog("[Warning] 要构建的版本低于上次构建版本: " + this.version + "<=" + buildVersion); + } + } else { + this._addLog("[Warning] version 填写的版本低于远程版本"); + } + + + } else {// 未发现远程版本 + + } + // let nowTime = new Date().getTime(); + // if (nowTime !== buildTime) { + // if (genVersion === this.version) { + // this._addLog("版本一致,请构建项目"); + // } else { + // } + // } + this._saveConfig(); + }, + onInPutUrlOver(event) { + let url = this.serverRootDir; + let index1 = url.indexOf("http://"); + let index2 = url.indexOf("https://"); + if (index1 === -1 && index2 === -1) { + let reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/; + if (!reg.test(url)) { + this._addLog(url + " 不是以http://https://开头,或者不是网址, 已经自动修改"); + this.serverRootDir = "http://" + this.serverRootDir; + this._getRemoteServerVersion(); + } + } else { + // 更新服务器版本 + this._getRemoteServerVersion(); + } + this._addHotAddress(this.serverRootDir); + this._updateShowUseAddrBtn(); + this._saveConfig(); + }, + // 获取远程资源服务器的版本号 + _getRemoteServerVersion() { + if (this.serverRootDir.length <= 0) { + console.log("远程资源服务器URL错误: " + this.serverRootDir); + return; + } + // TODO 浏览器缓存会导致版本号获取失败 + this.isShowRemoteServerVersion = false; + this.remoteServerVersion = null; + let versionUrl = this.serverRootDir + "/version.manifest"; + + let xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4 && ((xhr.status >= 200 && xhr.status < 400))) { + let text = xhr.responseText; + // console.log("版本文件内容\n" + versionUrl + "\n" + text); + let json = null; + try { + json = JSON.parse(text); + } catch (e) { + console.log(e); + this._addLog("获取远程版本号失败!"); + return; + } + this.isShowRemoteServerVersion = true; + this.remoteServerVersion = json.version; + } else if (xhr.status === 404) { + // console.log("404"); + } + }.bind(this); + xhr.open('get', versionUrl, true); + xhr.setRequestHeader("If-Modified-Since", "0");// 不缓存 + xhr.send(); + }, + onTestUrl() { + let url = this.serverRootDir; + if (url.length > 0) { + this._isUrlAvilable(url, function (code) { + this._addLog(url + " 响应: " + code); + }.bind(this)); + } else { + this._addLog("请填写 [资源服务器url] "); + } + }, + _isUrlAvilable(url, callback) { + let http = require("http"); + try { + http.get(url, function (res) { + if (callback) { + callback(res.statusCode); + } + //let text; + //res.setEncoding('utf8'); + //res.on('data', function (chunk) { + // text += chunk; + // console.log(text); + //}); + }.bind(this)); + } catch (e) { + callback(-1); + } + }, + // 访问测试网站 + onOpenUrl(event) { + let url = this.serverRootDir; + if (url.length > 0) { + Electron.shell.openExternal(url); + } else { + this._addLog("未填写参数"); + } + }, + userLocalIP() { + let ip = ""; + let os = require('os'); + let network = os.networkInterfaces(); + for (let i = 0; i < network.WLAN.length; i++) { + let json = network.WLAN[i]; + if (json.family === 'IPv4') { + ip = json.address; + } + } + console.log(ip); + if (ip.length > 0) { + this.serverRootDir = "http://" + ip; + this.onInPutUrlOver(null); + } + }, + // 选择资源文件目录 + onSelectSrcDir(event) { + let res = Editor.Dialog.openFile({ + title: "选择Src目录", + defaultPath: Editor.projectInfo.path, + properties: ['openDirectory'], + callback: function (fileNames) { + + }, + }); + if (res !== -1) { + this.srcDirPath = res[0]; + this._saveConfig(); + } + }, + onSelectResDir() { + let res = Editor.Dialog.openFile({ + title: "选择Res目录", + defaultPath: Editor.projectInfo.path, + properties: ['openDirectory'], + }); + if (res !== -1) { + this.resDirPath = res[0]; + this._saveConfig(); + } + }, + // 选择projManifest文件 + onOpenResourceDir() { + if (!fs.existsSync(this.resourceRootDir)) { + this._addLog("目录不存在:" + this.resourceRootDir); + return; + } + Electron.shell.showItemInFolder(this.resourceRootDir); + Electron.shell.beep(); + }, + onOpenManifestDir() { + if (!fs.existsSync(this.genManifestDir)) { + this._addLog("目录不存在:" + this.genManifestDir); + return; + } + Electron.shell.showItemInFolder(this.genManifestDir); + Electron.shell.beep(); + }, + onOpenLocalServer() { + if (!fs.existsSync(this.genManifestDir)) { + this._addLog("目录不存在:" + this.localServerPath); + return; + } + Electron.shell.showItemInFolder(this.localServerPath); + Electron.shell.beep(); + }, + // 选择生成Manifest的目录 + onSelectGenManifestDir() { + let res = Editor.Dialog.openFile({ + title: "选择生成Manifest目录", + defaultPath: Editor.projectInfo.path, + properties: ['openDirectory'], + }); + if (res !== -1) { + this.genManifestDir = res[0]; + this._saveConfig(); + } + }, + onSelectGenServerRootDir() { + let res = Editor.Dialog.openFile({ + title: "选择部署的服务器根目录", + defaultPath: Editor.projectInfo.path, + properties: ['openDirectory'], + }); + if (res !== -1) { + this.serverRootDir = res[0]; + this._saveConfig(); + } + }, + onSelectResourceRootDir() { + let res = Editor.Dialog.openFile({ + title: "选择构建后的根目录", + defaultPath: Editor.projectInfo.path, + properties: ['openDirectory'], + }); + if (res !== -1) { + let dir = res[0]; + if (this._checkResourceRootDir(dir)) { + this.resourceRootDir = dir; + this._saveConfig(); + } + } + }, + onCleanSimRemoteRes() { + let path = require("fire-path"); + let simPath = path.join(__dirname, "../cocos2d-x/simulator/win32"); + let remoteAsset = path.join(simPath, "remote-asset"); + if (!fs.existsSync(remoteAsset)) { + console.log(remoteAsset); + this._addLog("[清理热更缓存] 目录不存在: " + remoteAsset); + } else { + FileUtil.emptyDir(remoteAsset); + this._addLog("[清理热更缓存] 清空目录 " + remoteAsset + " 成功."); + } + }, + onOpenLocalGameManifestDir() { + let strArr = this.localGameProjectManifest.split("project.manifest"); + let dir = strArr[0]; + + if (!fs.existsSync(dir)) { + this._addLog("目录不存在:" + dir); + return; + } + Electron.shell.showItemInFolder(dir); + Electron.shell.beep(); + }, + onTestZip() { + let zip = require("node-native-zip"); + }, + // + onTestSelect() { + let ip = Math.random() * 100; + this.hotAddressArray.push(ip.toFixed(2)); + selectionLast(this.hotAddressArray.length - 1); + }, + onIpSelectChange(event) { + console.log("index:%d, text:%s, value:%s ", event.detail.index, event.detail.text, event.detail.value); + }, + onLogIp() { + // getSelectIp(); + Editor.Ipc.sendToMain('hot-update-tools:test', 'Hello, this is simple panel'); + // let relativePath = path.relative(__dirname, path.join(Editor.projectInfo.path, 'assets')); + // console.log(relativePath); + }, + onTestEnvChange(event) { + // let children = event.target.$select.children; + // for (let i = 0; i < children.length; i++) { + // let item = children[i]; + // if (item.value === "0") { + // item.selected = true; + // } else { + // item.selected = false; + // } + // } + let selectValue = event.target.value; + this.testEnvALi = false; + this.testEnvLocal = false; + this.testEnvEmail = false; + if (selectValue === "0") {// 本地测试环境 + this.testEnvLocal = true; + } else if (selectValue === "1") {//阿里云测试环境 + this.testEnvALi = true; + } else if (selectValue === "2") { + this.testEnvEmail = true; + } + }, + } + }); + }, + + + messages: { + 'hot-update-tools:onBuildFinished'(event, time) { + window.plugin.onBuildFinished(time); + }, + + } + +}); \ No newline at end of file diff --git a/packages/hot-update-tools/panel/test.js b/packages/hot-update-tools/panel/test.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/hot-update-tools/test/TestEnvAli.html b/packages/hot-update-tools/test/TestEnvAli.html new file mode 100644 index 0000000..e69de29 diff --git a/packages/hot-update-tools/test/TestEnvAli.js b/packages/hot-update-tools/test/TestEnvAli.js new file mode 100644 index 0000000..137a435 --- /dev/null +++ b/packages/hot-update-tools/test/TestEnvAli.js @@ -0,0 +1,14 @@ +'use strict'; +var Fs = require('fire-fs'); +var Path = require('fire-path'); +let url = Editor.url(window.packageRoot + "panel/TestEnvAli.html", 'utf8'); + + +module.exports = { + init() { + Vue.component('TestEnvAli', { + props: ['data'], + template: Fs.readFileSync(url), + }); + }, +}; diff --git a/packages/hot-update/main.js b/packages/hot-update/main.js new file mode 100644 index 0000000..3224a9a --- /dev/null +++ b/packages/hot-update/main.js @@ -0,0 +1,44 @@ +'use strict'; + +var Fs = require("fire-fs"); +var Path = require("fire-path"); + +module.exports = { + load: function () { + // 当 package 被正确加载的时候执行 + }, + + unload: function () { + // 当 package 被正确卸载的时候执行 + }, + + messages: { + 'editor:build-finished': function (event, target) { + var root = Path.normalize(target.dest); + var url = Path.join(root, "main.js"); + Fs.readFile(url, "utf8", function (err, data) { + if (err) { + throw err; + } + + var newStr = + "(function () { \n"+ + "\n"+ + " if (cc.sys.isNative) { \n" + + " var hotUpdateSearchPaths = cc.sys.localStorage.getItem('HotUpdateSearchPaths'); \n" + + " if (hotUpdateSearchPaths) { \n" + + " jsb.fileUtils.setSearchPaths(JSON.parse(hotUpdateSearchPaths)); \n" + + " }\n" + + " }"; + + var newData = data.replace("(function () {", newStr); + Fs.writeFile(url, newData, function (error) { + if (err) { + throw err; + } + Editor.log("SearchPath updated in built main.js for hot update"); + }); + }); + } + } +}; \ No newline at end of file diff --git a/packages/hot-update/package.json b/packages/hot-update/package.json new file mode 100644 index 0000000..b6a0286 --- /dev/null +++ b/packages/hot-update/package.json @@ -0,0 +1,7 @@ +{ + "name": "hot-update", + "version": "0.0.1", + "description": "用于热更新插件", + "author": "Cocos Creator", + "main": "main.js" +} \ No newline at end of file diff --git a/remote-assets/project.manifest b/remote-assets/project.manifest new file mode 100644 index 0000000..13fa209 --- /dev/null +++ b/remote-assets/project.manifest @@ -0,0 +1 @@ +{"packageUrl":"https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/","remoteManifestUrl":"https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/project.manifest","remoteVersionUrl":"https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/version.manifest","version":"1.0.2","assets":{"src/cocos2d-jsb.js":{"size":2994873,"md5":"54eb9e8c7718557d8e6aa101ad137d37"},"src/settings.js":{"size":500,"md5":"d989547c4773fe77c3dac0293e87e174"},"assets/main/index.js":{"size":435919,"md5":"ae48365ba7b69d9e57fccd8308cb262d"}},"searchPaths":[]} \ No newline at end of file diff --git a/remote-assets/version.manifest b/remote-assets/version.manifest new file mode 100644 index 0000000..5deb797 --- /dev/null +++ b/remote-assets/version.manifest @@ -0,0 +1 @@ +{"packageUrl":"https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/","remoteManifestUrl":"https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/project.manifest","remoteVersionUrl":"https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/version.manifest","version":"1.0.2"} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 93c0b22..dd2485b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,31 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ "es2015", "es2017", "dom" ], - "target": "es5", - "experimentalDecorators": true, - "skipLibCheck": true, - "outDir": "temp/vscode-dist", - "forceConsistentCasingInFileNames": true - }, - "exclude": [ - "node_modules", - "library", - "local", - "temp", - "build", - "settings" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es2015", + "es2017", + "dom" + ], + "target": "es5", + "allowJs": true, + "experimentalDecorators": true, + "skipLibCheck": true, + "outDir": "temp/vscode-dist", + "forceConsistentCasingInFileNames": true, + "downlevelIteration": true, + "sourceMap": true + }, + "exclude": [ + "node_modules", + "library", + "local", + "temp", + "build", + "settings", + ".git", + ".vscode", + "build-templates", + "preview-templates", + "packages" + ] } \ No newline at end of file diff --git a/version_generator.js b/version_generator.js new file mode 100644 index 0000000..342862e --- /dev/null +++ b/version_generator.js @@ -0,0 +1,115 @@ +var fs = require('fs'); +var path = require('path'); +var crypto = require('crypto'); + +var manifest = { + packageUrl: 'http://localhost/tutorial-hot-update/remote-assets/', + remoteManifestUrl: 'http://localhost/tutorial-hot-update/remote-assets/project.manifest', + remoteVersionUrl: 'http://localhost/tutorial-hot-update/remote-assets/version.manifest', + version: '1.0.0', + assets: {}, + searchPaths: [] +}; + +var dest = './remote-assets/'; +var src = './jsb/'; + +// Parse arguments +var i = 2; +while (i < process.argv.length) { + var arg = process.argv[i]; + + switch (arg) { + case '--url': + case '-u': + var url = process.argv[i + 1]; + manifest.packageUrl = url; + manifest.remoteManifestUrl = url + 'project.manifest'; + manifest.remoteVersionUrl = url + 'version.manifest'; + i += 2; + break; + case '--version': + case '-v': + manifest.version = process.argv[i + 1]; + i += 2; + break; + case '--src': + case '-s': + src = process.argv[i + 1]; + i += 2; + break; + case '--dest': + case '-d': + dest = process.argv[i + 1]; + i += 2; + break; + default: + i++; + break; + } +} + + +function readDir(dir, obj) { + var stat = fs.statSync(dir); + if (!stat.isDirectory()) { + return; + } + var subpaths = fs.readdirSync(dir), subpath, size, md5, compressed, relative; + for (var i = 0; i < subpaths.length; ++i) { + if (subpaths[i][0] === '.') { + continue; + } + subpath = path.join(dir, subpaths[i]); + stat = fs.statSync(subpath); + if (stat.isDirectory()) { + readDir(subpath, obj); + } + else if (stat.isFile()) { + // Size in Bytes + size = stat['size']; + md5 = crypto.createHash('md5').update(fs.readFileSync(subpath, 'binary')).digest('hex'); + compressed = path.extname(subpath).toLowerCase() === '.zip'; + + relative = path.relative(src, subpath); + relative = relative.replace(/\\/g, '/'); + relative = encodeURI(relative); + obj[relative] = { + 'size': size, + 'md5': md5 + }; + if (compressed) { + obj[relative].compressed = true; + } + } + } +} + +var mkdirSync = function (path) { + try { + fs.mkdirSync(path); + } catch (e) { + if (e.code != 'EEXIST') throw e; + } +} + +// Iterate res and src folder +readDir(path.join(src, 'src'), manifest.assets); +readDir(path.join(src, 'assets'), manifest.assets); + +var destManifest = path.join(dest, 'project.manifest'); +var destVersion = path.join(dest, 'version.manifest'); + +mkdirSync(dest); + +fs.writeFile(destManifest, JSON.stringify(manifest), (err) => { + if (err) throw err; + console.log('Manifest successfully generated'); +}); + +delete manifest.assets; +delete manifest.searchPaths; +fs.writeFile(destVersion, JSON.stringify(manifest), (err) => { + if (err) throw err; + console.log('Version successfully generated'); +});