Commit f2032c4e authored by liujiangnan's avatar liujiangnan

feat: 初始化

parent f8f29464
{"frameRate":30,"name":"loading","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"Armature","aabb":{"x":-128,"y":-129,"width":256,"height":258},"bone":[{"name":"root","transform":{"skX":77.5101,"skY":77.5101}}],"slot":[{"name":"IP小星星","parent":"root"}],"skin":[{"slot":[{"name":"IP小星星","display":[{"name":"IP小星星","transform":{"scX":0.2266,"scY":0.2266}}]}]}],"animation":[{"duration":48,"playTimes":0,"name":"newAnimation","bone":[{"name":"root","rotateFrame":[{"duration":24,"tweenEasing":0,"rotate":-77.51},{"tweenEasing":0,"rotate":102.49},{"duration":23,"tweenEasing":0,"rotate":106.76},{"duration":0,"rotate":-77.51}]}]}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "32d4c07d-d14c-472e-9982-d77b5f99f84a",
"subMetas": {}
}
\ No newline at end of file
{"name":"loading","SubTexture":[{"name":"IP小星星","x":1,"height":249,"frameY":-4,"y":1,"frameHeight":258,"frameX":-2,"frameWidth":256,"width":252}],"imagePath":"loading_tex.png","height":256,"width":256}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "3cf68978-c51e-4094-8539-c768bbfaf05a",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "daad9123-eef3-4934-8ddb-6a181b8f358a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 256,
"platformSettings": {},
"subMetas": {
"loading_tex": {
"ver": "1.0.4",
"uuid": "f6082448-b4d2-48c4-9132-422baa8ee7be",
"rawTextureUuid": "daad9123-eef3-4934-8ddb-6a181b8f358a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 2.5,
"trimX": 1,
"trimY": 1,
"width": 252,
"height": 249,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -212,7 +212,7 @@
"r": 0,
"g": 0,
"b": 0,
"a": 0
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
......@@ -299,31 +299,31 @@
"__id__": 9
},
{
"__id__": 12
"__id__": 13
},
{
"__id__": 14
"__id__": 17
},
{
"__id__": 26
"__id__": 21
},
{
"__id__": 30
"__id__": 23
},
{
"__id__": 32
"__id__": 33
},
{
"__id__": 34
"__id__": 35
}
],
"_active": true,
"_components": [
{
"__id__": 46
"__id__": 37
},
{
"__id__": 47
"__id__": 38
}
],
"_prefab": null,
......@@ -376,19 +376,22 @@
},
{
"__type__": "cc.Node",
"_name": "loadingBg",
"_name": "ExitBtn",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 10
},
{
"__id__": 11
},
{
"__id__": 12
}
],
"_prefab": null,
......@@ -402,8 +405,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"width": 171,
"height": 146
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -414,15 +417,15 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-577.25,
303.5,
0,
0,
0,
0,
0,
0,
1,
1,
1,
0.5,
0.5,
1
]
},
......@@ -437,39 +440,75 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "c6O7HQTtpHyoy08KGsEliH"
"_id": "eacQSP+NxNWYIBuiqnv/FH"
},
{
"__type__": "cc.Sprite",
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
"_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
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "bfoJejCMtPp5YaWNfpv/Ts"
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "25VWkik+9GAKOaKfpA9Tf6"
},
{
"__type__": "cc.Widget",
......@@ -479,12 +518,12 @@
"__id__": 9
},
"_enabled": true,
"alignMode": 1,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_alignFlags": 9,
"_left": 20,
"_right": 0,
"_top": 0,
"_top": 20,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
......@@ -494,13 +533,45 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "3d/Tt/ythNs6hjxxVMXCGH"
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "669Abf8UBIJ5w+8w83zBHw"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "dae06413-7c06-4a99-8a27-fc098af38812"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "30FbSxv/hP9r+UK0P/aTYj"
},
{
"__type__": "cc.Node",
"_name": "loadingLayer",
"_name": "BtnLeft",
"_objFlags": 0,
"_parent": {
"__id__": 8
......@@ -509,7 +580,13 @@
"_active": false,
"_components": [
{
"__id__": 13
"__id__": 14
},
{
"__id__": 15
},
{
"__id__": 16
}
],
"_prefab": null,
......@@ -523,8 +600,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 256,
"height": 258
"width": 209,
"height": 146
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -535,15 +612,15 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
437.75,
303.5,
0,
0,
0,
0,
0,
0,
1,
1,
1,
-0.5,
0.5,
1
]
},
......@@ -558,14 +635,109 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "dcbdHfvwdLRaq6IEt7QTpA"
"_id": "373lsjYxpDjpBPdG7XpKNm"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "74T1oR96VGfbL7Rscguciw"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 33,
"_left": 20,
"_right": 150,
"_top": 20,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 61,
"_originalHeight": 0,
"_id": "4bUHjla2BOwLTjCU561v1O"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 13
},
"_enabled": true,
"_materials": [
......@@ -573,544 +745,28 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "newAnimation",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "32d4c07d-d14c-472e-9982-d77b5f99f84a#3cf68978-c51e-4094-8539-c768bbfaf05a",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "32d4c07d-d14c-472e-9982-d77b5f99f84a"
},
"_N$dragonAtlasAsset": {
"__uuid__": "3cf68978-c51e-4094-8539-c768bbfaf05a"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "7brIT9b3hCYpDdmPnl9Qzo"
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b2282c0f-dd0f-4bf3-9d51-63fd72bd25ca"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "34fnL+7EFC5ahjRfoVG4qk"
},
{
"__type__": "cc.Node",
"_name": "pageProgress",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [
{
"__id__": 15
},
{
"__id__": 18
},
{
"__id__": 21
}
],
"_active": true,
"_components": [
{
"__id__": 24
},
{
"__id__": 25
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 224,
"g": 228,
"b": 215,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1000,
"height": 15
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-56.139999999999986,
-304.762,
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": "22lyWzojdGH49LSi24ycI8"
},
{
"__type__": "cc.Node",
"_name": "bar",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
},
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 71,
"g": 170,
"b": 254,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1,
"height": 15
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-500,
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": "8enpco6JJPNYCSRRLsU3hn"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "08YS2BS/9MA4Gj2EBcQufw"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_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": "2e+2thvcdExL9jDhGY5CiR"
},
{
"__type__": "cc.Node",
"_name": "stage",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 19
},
{
"__id__": 20
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 71,
"g": 170,
"b": 253,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 65.33,
"height": 31.5
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
520,
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": "759eYKsRNPmaSE2PxeTWZR"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "Stage",
"_N$string": "Stage",
"_fontSize": 25,
"_lineHeight": 25,
"_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": "52euDPsjdHeKTSv0c2MEPQ"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right": -85.33000000000004,
"_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": "cfUHIY8WxDQqgMiLWO5YoC"
},
{
"__type__": "cc.Node",
"_name": "page",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 22
},
{
"__id__": 23
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 71,
"g": 170,
"b": 253,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 34.75,
"height": 31.5
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
593.784,
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": "10j2YoNyJGnZloObMgCuwY"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "1/4",
"_N$string": "1/4",
"_fontSize": 25,
"_lineHeight": 25,
"_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": "82+zkn9SJIsZy6kOKuzqCD"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right": -128.534,
"_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": "e5aX1bl0JAbJiHwczFtgEr"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "acbgoDusNCT5PdXJyJ+Vlj"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 44,
"_left": 83.86000000000001,
"_right": 196.14,
"_top": 0,
"_bottom": 47.738,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1000,
"_originalHeight": 0,
"_id": "1dGYeHvYBG557BdCrymK1R"
},
{
"__type__": "cc.Node",
"_name": "mask",
"_name": "BtnRight",
"_objFlags": 0,
"_parent": {
"__id__": 8
......@@ -1119,28 +775,28 @@
"_active": false,
"_components": [
{
"__id__": 27
"__id__": 18
},
{
"__id__": 28
"__id__": 19
},
{
"__id__": 29
"__id__": 20
}
],
"_prefab": null,
"_opacity": 0,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"width": 209,
"height": 146
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1151,15 +807,15 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
567.75,
303.5,
0,
0,
0,
0,
0,
0,
1,
1,
1,
0.5,
0.5,
1
]
},
......@@ -1174,41 +830,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "99Dj7SSYxItKIgEY1N79mA"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
},
"_enabled": true,
"alignMode": 2,
"_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": 0,
"_originalHeight": 0,
"_id": "c6QYh6a3xJgq40gtvV2x7F"
"_id": "8cBKHK6udLybTPmRmBBF98"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
"__id__": 17
},
"_enabled": true,
"_normalMaterial": null,
......@@ -1269,14 +898,41 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "97JBLAzUJEa70YQRzWLGBS"
"_id": "c5vS0hDupNequQ4j3jK6Uk"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 33,
"_left": 20,
"_right": 20,
"_top": 20,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 84,
"_originalHeight": 0,
"_id": "e3o0XQ1KlN9qhDSk0KTqMm"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
"__id__": 17
},
"_enabled": true,
"_materials": [
......@@ -1287,10 +943,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
"__uuid__": "b2282c0f-dd0f-4bf3-9d51-63fd72bd25ca"
},
"_type": 0,
"_sizeMode": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -1301,7 +957,7 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a8DKzGuzZEFJXL6eBHARw0"
"_id": "ccVC042cxCdIpDBInpf/O+"
},
{
"__type__": "cc.Node",
......@@ -1311,10 +967,10 @@
"__id__": 8
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 22
}
],
"_prefab": null,
......@@ -1370,7 +1026,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
"__id__": 21
},
"_enabled": true,
"_layoutSize": {
......@@ -1399,117 +1055,23 @@
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 33
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_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": "45WEE2echIUY1/z1Z88Exf"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "51nBXWjLpNUIamFPlMloSh"
},
{
"__type__": "cc.Node",
"_name": "preload",
"_name": "loadingLayer",
"_objFlags": 0,
"_parent": {
"__id__": 8
},
"_children": [
{
"__id__": 35
"__id__": 24
}
],
"_active": false,
"_components": [
{
"__id__": 44
"__id__": 31
},
{
"__id__": 45
"__id__": 32
}
],
"_prefab": null,
......@@ -1523,8 +1085,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
"width": 5000,
"height": 5000
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1558,57 +1120,56 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "09nHnHDflBQIyaDqoik/Bm"
"_id": "74vmJ2zBBM+bb8ymP3WkKK"
},
{
"__type__": "cc.Node",
"_name": "progress",
"_objFlags": 0,
"_parent": {
"__id__": 34
"__id__": 23
},
"_children": [
{
"__id__": 36
},
{
"__id__": 39
"__id__": 25
}
],
"_active": true,
"_components": [
{
"__id__": 42
"__id__": 28
},
{
"__id__": 43
"__id__": 29
}
],
"_prefab": null,
"_prefab": {
"__id__": 30
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 224,
"g": 228,
"b": 215,
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1000,
"height": 15
"width": 511,
"height": 45
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-56.139999999999986,
-304.762,
-255.5,
-138.77,
0,
0,
0,
......@@ -1630,38 +1191,37 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "48UXJjCM1GJJ3fDARyj6QG"
"_id": "b6K+2mRlhGkoAlBMrLb+Hn"
},
{
"__type__": "cc.Node",
"_name": "bar",
"_objFlags": 0,
"_parent": {
"__id__": 35
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 37
},
{
"__id__": 38
"__id__": 26
}
],
"_prefab": null,
"_prefab": {
"__id__": 27
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 71,
"g": 170,
"b": 254,
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1,
"height": 15
"width": 490,
"height": 26
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1672,8 +1232,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-500,
0,
11.627,
4.096,
0,
0,
0,
......@@ -1695,14 +1255,110 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b5rB+LdONCroYbKOA4nbpC"
"_id": "84tAZwPMRIDawBBvn2WwH0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "c8263dcf-d226-41b6-8cea-42be19fdb92a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "57HVwIx65Fyp9gm0BfBu8J"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 24
},
"asset": {
"__uuid__": "3d356c4d-cb23-4239-aa5f-8a913f420fa4"
},
"fileId": "7dOjkMYWpFQaM6/QbKkBy/",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a72e2ca1-5791-4a3f-8a09-5e73e061b76a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a2Adx5oCZGManyuQiQGie3"
},
{
"__type__": "ff03b/26RFLJo4ogDzcFsUP",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
},
"_enabled": true,
"_id": "3eMT/DXoJNGZT/8Z3nuTUH"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 24
},
"asset": {
"__uuid__": "3d356c4d-cb23-4239-aa5f-8a913f420fa4"
},
"fileId": "",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
"__id__": 23
},
"_enabled": true,
"_materials": [
......@@ -1727,76 +1383,56 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a7g5G+ztlG6olc9K5DSuSZ"
"_id": "f20BTU3S9O2qF/2RyA7ZKv"
},
{
"__type__": "cc.Widget",
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
"__id__": 23
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_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": "53a9o1Yn9HQpLAYBmDWwU0"
"_id": "d9Sm5lOKBAxKufJF2Q8Nr8"
},
{
"__type__": "cc.Node",
"_name": "page",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 35
"__id__": 8
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 40
},
{
"__id__": 41
"__id__": 34
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 71,
"g": 170,
"b": 253,
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 36.13,
"height": 31.5
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
531.228,
0,
0,
0,
0,
......@@ -1819,74 +1455,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "afqx9CW1BA8KtTPd5Y5D5u"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "0%",
"_N$string": "0%",
"_fontSize": 25,
"_lineHeight": 25,
"_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": "a5zsZjHPBAeoh5n9eFLMKT"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right": -67.35799999999995,
"_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": "1b92itqzhPjLvjWf36klzI"
"_id": "45WEE2echIUY1/z1Z88Exf"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 35
"__id__": 33
},
"_enabled": true,
"_materials": [
......@@ -1911,93 +1487,79 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "0fhMmhwTRC97UJG2m/WjRN"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 35
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 44,
"_left": 83.86000000000001,
"_right": 196.14,
"_top": 0,
"_bottom": 47.738,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1000,
"_originalHeight": 0,
"_id": "e7QaxmoVRHaIfvr8PWXBlX"
"_id": "51nBXWjLpNUIamFPlMloSh"
},
{
"__type__": "cc.Sprite",
"_name": "",
"__type__": "cc.Node",
"_name": "Destroyer",
"_objFlags": 0,
"node": {
"__id__": 34
"_parent": {
"__id__": 8
},
"_enabled": true,
"_materials": [
"_children": [],
"_active": false,
"_components": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
"__id__": 36
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0
"y": 0,
"z": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "2b1to7ep1H3qLObFYb92az"
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "86SJcyXClP7YiYvVyxTK6m"
},
{
"__type__": "cc.Widget",
"__type__": "8de31/QRmtJB70uxA6JCYx9",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
"__id__": 35
},
"_enabled": true,
"alignMode": 1,
"_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": 1280,
"_originalHeight": 720,
"_id": "d9gF393RxHcp+zqjajtXE1"
"_id": "c8RSZKHRJO95/RfIMIkSA5"
},
{
"__type__": "cc.Widget",
......
cc.Class({
extends: cc.Component,
start() {
this.middleLayer = cc.find('middleLayer').getComponent('middleLayer');
},
onDestroy() {
console.log('喵喵喵: destroyer onDestroy');
this.middleLayer.clearDragonDisplayAssetList();
}
});
{
"ver": "1.0.8",
"uuid": "8de31fd0-466b-4907-bd2e-c40e89098c7d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
const testMockData = {"file":"/storage/emulated/0/Android/data/com.example.oxford/cache/shengtong/gradeVoice.mp3","audioUrl":"https://staging-teach.cdn.ireadabc.com/9bee787cf2a1934ccaf7dd596ede9c91.mp3","version":"2.3.9","eof":1,"tokenId":"629f0fe93327936c0b000001","result":{"duration":"3.620","fluency":91,"integrity":100,"kernel_version":"3.7.1","overall":92,"pronunciation":95,"resource_version":"2.3.6","rhythm":74,"sentences":[{"details":[{"overall":94,"word":"what"},{"overall":98,"word":"can"},{"overall":99,"word":"i"},{"overall":77,"word":"do"},{"overall":100,"word":"for"},{"overall":100,"word":"you"}],"overall":88,"sentence":"what can i do for you"}],"speed":162}};
const testMockData = {"eof":1,"file":"/storage/emulated/0/Android/data/com.example.oxford/cache/shengtong/gradeVoice.mp3","audioUrl":"https://staging-teach.cdn.ireadabc.com/db48d49e122ba65aa7c5ee56963418a6.mp3","result":{"duration":"2.470","fluency":100,"integrity":100,"kernel_version":"3.6.7","overall":99,"pronunciation":99,"resource_version":"2.3.6","rhythm":0,"speed":78},"tokenId":"621c32543327932cfc000002"};
const recordMockData = {"text":"what can i do for you","audioUrl":"https://staging-teach.cdn.ireadabc.com/368ad56174f85e2ff1f39f12bac5c693.mp3"};
export function initAir(_this) {
......@@ -25,6 +25,9 @@ export function initAir(_this) {
osmoFingerReadCallback: function (res) {
_this.log(`***成功调用osmoFingerReadCallback***参数==${res}`);
},
dialogStatus: function (res) {
_this.log(`***成功调用dialogStatus***参数==${res}`);
},
startScanCodeCallback: null,
needUpdateCallback: null,
getEngineInfoCallback: null,
......@@ -193,6 +196,18 @@ export function initAir(_this) {
};
window.courseware.callOcMethod("getEngineInfo", {});
},
exitApp() {
_this.log(`===成功调用exitApp===`);
window.courseware.callOcMethod("exitApp", {});
},
changeHost() {
_this.log(`===成功调用changeHost===`);
// 调用原生获取机器信息
if (window.air.engineInfo) {
const engineInfo = JSON.parse(window.air.engineInfo);
window.courseware.callOcMethod("changeHost", {isStagingEnv: engineInfo.isDev != 1});
}
},
needUpdate(label, url, callback) {
_this.log(`===成功调用needUpdate===`);
// 调用原生获取机器信息
......
......@@ -5,34 +5,10 @@ const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends middleLayerBase {
showMask() {
}
hideMask() {
}
onCourseWareLoaded() {
// 课件加载完成的钩子
const process = cc.find(`middleLayer/pageProgress`);
const bar = cc.find(`bar`, process);
const barWidth = process.width * 1 / this.courses.length;
cc.tween(bar).to(0.5, { width: barWidth }).start();
const page = cc.find(`page`, process);
page.getComponent(cc.Label).string = `${this.courseIndex+1}/${this.courses.length}`;
}
// 需要预加载的数量
preloadCount = null;
// 统计已加载的数量
loadedCount = null;
role;
// 统一释放异步资源的方法
async onLoad() {
this.preloadCount = 0;
this.loadedCount = 0;
initAir(this);
this.reWriteAir();
this.role = 'student';
......@@ -46,184 +22,19 @@ export default class NewClass extends middleLayerBase {
global.middleLayer = cc.find('middleLayer').getComponent('middleLayer');
// 预加载
// await this.preloadAll();
cc.find(`middleLayer/preload`).active = false;
this.loadOnlineCourseWare(23751);
}
async preloadAll() {
if ((<any>window).preloadBundleAndSourcesFlag) {
// 只加载一次就行了
return;
}
(<any>window).preloadBundleAndSourcesFlag = true;
let platform = "web_desktop";
if (cc.sys.os == cc.sys.OS_IOS) {
platform = "ios";
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
platform = "android";
}
const datastr:any = await this.asyncCallNetworkApiGet(`/api/syllabus/v1/allbundles`, { orgid: 512, platform });
const data = JSON.parse(datastr);
if (data.rows && data.rows.length > 0) {
this.preloadCount += data.rows.length;
}
const datastr1:any = await this.asyncCallNetworkApiGet(`/api/syllabus/v1/allresources`, { orgid: 512 });
const data1 = JSON.parse(datastr1);
if (data1.rows && data1.rows.length > 0) {
this.preloadCount += data1.rows.length;
}
console.log('data.rows = ' + JSON.stringify(data.rows));
await this.preloadSceneAndSource(data, data1);
}
preloadSceneAndSource(scenes, sources) {
const p1 = this.batchPreloadScene(scenes.rows);
const p2 = this.preloadSource(sources.rows);
return Promise.all([p1, p2]);
}
batchPreloadScene(scenes = []) {
return new Promise((resolve) => {
const expects = [
// 'op_03_2',
// 'OP10_online',
];
const _this = this;
let i = 0;
const load = function () {
const scene = scenes[i];
if (expects.includes(scene.sceneName)) {
_this.loadedCount++;
_this.updateProcessBar();
i++;
if (i < scenes.length) {
setTimeout(() => {
load();
}, 1);
} else {
resolve();
}
return;
}
try {
cc.assetManager.loadBundle(scene.bondleUrl, { version: scene.version }, (err, bundle) => {
console.log(`${scene.bondleUrl}---场景开始loadBundle----`);
if (!bundle) {
_this.loadedCount++;
_this.updateProcessBar();
i++;
if (i < scenes.length) {
setTimeout(() => {
load();
}, 1);
} else {
resolve();
}
return;
}
try {
bundle.preloadScene(scene.sceneName, () => { }, () => {
console.log(`${scene.sceneName}场景预加载结束`);
_this.loadedCount++;
_this.updateProcessBar();
i++;
if (i < scenes.length) {
setTimeout(() => {
load();
}, 1);
} else {
resolve();
}
});
} catch (error) {}
});
} catch(e) {}
}
if (scenes && scenes.length > 0) {
load();
} else {
resolve();
}
});
}
preloadSource(array) {
return new Promise((resolve) => {
const rows = array || [];
let loadFlag = 0;
const batchLoad = () => {
let tempArr = rows.splice(0, 10);
let len = tempArr.length;
for (let i = 0; i < tempArr.length; i++) {
cc.assetManager.loadRemote(tempArr[i], (err, texture) => {
if (err) {
console.log(err)
}
this.loadedCount++;
this.updateProcessBar();
if (i === len - 1) {
batchLoad();
}
loadFlag ++;
if (loadFlag == rows.length) {
resolve();
}
});
}
}
batchLoad();
});
}
updateProcessBar() {
const label = cc.find("middleLayer/preload/progress/page").getComponent(cc.Label);
label.string = `${Math.floor(this.loadedCount/this.preloadCount*100)}%`;
// 课件加载完成的钩子
const process = cc.find(`middleLayer/preload/progress`);
const bar = cc.find(`bar`, process);
const barWidth = process.width / this.preloadCount * this.loadedCount;
bar.width = barWidth;
}
onHomeworkFinish(callBack, data = null) {
const loadingBg = cc.find('middleLayer/loadingBg');
loadingBg.opacity = 50;
this.goNextPage();
const process = cc.find(`middleLayer/pageProgress`);
const bar = cc.find(`bar`, process);
let barWidth = process.width / this.courses.length * (this.courseIndex+1);
barWidth = barWidth>process.width?process.width:barWidth;
cc.tween(bar).to(0.5, { width: barWidth }).start();
const page = cc.find(`page`, process);
page.getComponent(cc.Label).string = `${this.courseIndex+1}/${this.courses.length}`;
}
localMode = false;
asyncDelayLog(str) {
console.log(str);
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(null);
}, 1);
});
// TODO 上报总成绩
}
initListener() {
}
log(str) {
console.log(str);
}
reWriteAir() {
(<any>window).courseware.getData = (callback) => {
let data = null;
......@@ -233,22 +44,15 @@ export default class NewClass extends middleLayerBase {
this.log("===成功调用getData===" + JSON.stringify(data));
callback && callback(data);
}
(<any>window).courseware.nextPage = () => {
this.goNextPage();
}
(<any>window).courseware.beforePage = () => {
this.goPrePage();
}
(<any>window).courseware.sendAnswer = (answerObj) => {
this.log("===成功调用sendAnswer===" + JSON.stringify(answerObj));
this.callNetworkApiPost(`/api/oxford/courseware/v1/${this.courseItem.id}/saveanswer`, answerObj, (data) => {
this.callNetworkApiPost(`/api/dige/courseware/v1/${this.courseItem.id}/saveanswer`, answerObj, (data) => {
answerObj.callback && answerObj.callback(JSON.stringify(data.row));
});
}
(<any>window).courseware.getAnswer = (queryObj, callback) => {
this.log("===成功调用getAnswer===" + JSON.stringify(queryObj));
this.callNetworkApiGet(`/api/oxford/courseware/v1/${this.courseItem.id}/getanswer`, queryObj, (datastr) => {
this.callNetworkApiGet(`/api/dige/courseware/v1/${this.courseItem.id}/getanswer`, queryObj, (datastr) => {
const data = JSON.parse(datastr);
callback && callback(JSON.stringify(data.rows));
});
......@@ -263,68 +67,9 @@ export default class NewClass extends middleLayerBase {
(<any>window).air.onCourseInScreen = null;
});
this.hideWaitingLetters();
this.hideMask();
}
}
callNativeFunction(param) {
const paramStr = JSON.stringify(param);
if (cc.sys.isNative && cc.sys.os == cc.sys.OS_IOS) {
return jsb.reflection.callStaticMethod('CocosMng', 'cocosWithNativeProtocol:', paramStr);
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_ANDROID) {
return jsb.reflection.callStaticMethod('com/iplayabc/cocos/AppActivity', 'cocosWithNativeProtocol', '(Ljava/lang/String;)Ljava/lang/String;', paramStr);
} else if (cc.sys.isNative && cc.sys.os == cc.sys.OS_WINDOWS) {
console.log('汪汪汪')
} else {
console.error('非源生环境11');
}
}
isShowWaiting = false;
showWaitingLetters() {
if (this.isShowWaiting) {
return;
}
this.isShowWaiting = true;
const laodingLayer = cc.find('middleLayer/loadingLayer');
laodingLayer.active = true;
const loadingBg = cc.find('middleLayer/loadingBg');
loadingBg.active = true;
}
hideWaitingLetters() {
const loadingBg = cc.find('middleLayer/loadingBg');
loadingBg.active = false;
const laodingLayer = cc.find('middleLayer/loadingLayer');
laodingLayer.active = false;
this.isShowWaiting = false;
}
getRainbowColorList() {
return [
cc.color(255, 255, 0),
cc.color(128, 255, 0),
cc.color(0, 255, 0),
cc.color(0, 0, 0),
cc.color(0, 255, 128),
cc.color(0, 255, 255),
cc.color(0, 128, 255),
cc.color(0, 0, 255),
cc.color(128, 0, 255),
cc.color(255, 0, 255),
cc.color(255, 0, 128),
cc.color(255, 0, 0),
cc.color(255, 128, 0),
cc.color(255, 255, 0),
];
}
onMiddleLayerLoadingFinish() {
if (cc.sys.isNative && cc.sys.os == cc.sys.OS_IOS) {
jsb.reflection.callStaticMethod(
......
import { asyncDelay, randomSortByArr } from "./util";
export abstract class middleLayerBase extends cc.Component {
abstract reWriteAir(): void;
abstract showMask(): void;
abstract hideMask(): void;
abstract hideWaitingLetters(): void;
abstract showWaitingLetters(): void;
onCourseWareLoaded() {}
isShowWaiting = false;
hideWaitingLetters(){
this.isShowWaiting = false;
const layout = cc.find('middleLayer/layout');
layout.active = false;
const laodingLayer = cc.find('middleLayer/loadingLayer');
laodingLayer.active = false;
}
showWaitingLetters(){
if (this.isShowWaiting) {
return;
}
this.isShowWaiting = true;
const layout = cc.find('middleLayer/layout');
layout.removeAllChildren();
const canvas = cc.find("Canvas");
const bg = layout.addComponent(cc.Graphics);
bg.fillRect(-canvas.width / 2, -canvas.height / 2, canvas.width, canvas.height);
const laodingLayer = cc.find('middleLayer/loadingLayer');
laodingLayer.active = true;
const script = cc.find('middleLayer/loadingLayer/progress').getComponent('progressScript');
script.setProgress(0);
const id = setInterval(() => {
script.setProgress(changeObj.value);
}, 1);
const changeObj = { value: 0 };
cc.tween(changeObj)
.to(5, { value: 0.9 })
.call(() => {
clearInterval(id);
})
.start();
}
oldSceneName = null;
IS_BUNDLE_LOADING = false;
onMiddleLayerLoadingFinish() {
if (cc.sys.isNative && cc.sys.os == cc.sys.OS_IOS) {
jsb.reflection.callStaticMethod(
"RootViewController",
"getMiddleLayerInfoFinish:",
""
);
}
if (cc.sys.isNative && cc.sys.os == cc.sys.OS_ANDROID) {
jsb.reflection.callStaticMethod(
"com/iplayabc/cocos/AppActivity",
"getMiddleLayerInfoFinish",
"(Ljava/lang/String;)Ljava/lang/String;",
""
);
}
}
callNetworkApiPost(uri, data, callBack) {
this.getBaseUrl((baseUrl) => {
......@@ -46,12 +106,27 @@ export abstract class middleLayerBase extends cc.Component {
});
}
getConfigInfo(url, callback) {
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => {
if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
callback(JSON.parse(xhr.responseText));
}
};
console.log('url = ' + `${url}/config.json`);
xhr.open('GET', `${url}/config.json`, true);
xhr.send();
}
DOMAIN;
async getBaseUrl(callback) {
const engineInfo = await this.getEngineInfo();
const { isDev } = JSON.parse(engineInfo);
if (isDev == 1) {
this.DOMAIN = "http://staging-teach.cdn.ireadabc.com/";
callback('http://staging-openapi.iteachabc.com');
} else {
this.DOMAIN = "http://teach.cdn.ireadabc.com/";
callback('http://openapi.iteachabc.com');
}
}
......@@ -67,14 +142,14 @@ export abstract class middleLayerBase extends cc.Component {
});
}
}
asyncCallNetworkApiGet(apiName, data) {
asyncCallNetworkApiGet(apiName, data): Promise<any> {
return new Promise((resolve, reject) => {
this.callNetworkApiGet(apiName, data, (res => {
resolve(res);
}));
});
}
asyncCallNetworkApiPost(uri, data) {
asyncCallNetworkApiPost(uri, data): Promise<any> {
return new Promise((resolve, reject) => {
this.callNetworkApiPost(uri, data, (res) => {
resolve(res);
......@@ -82,60 +157,126 @@ export abstract class middleLayerBase extends cc.Component {
});
}
loadOnlineBundle(bundleName) {
this.callNetworkApiGet(`/api/template/v1/${bundleName}`, {}, (datastr) => {
const data = JSON.parse(datastr);
let configData = null;
if (cc.sys.os == cc.sys.OS_IOS) {
configData = data.data.conf.ios;
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
configData = data.data.conf.android;
} else {
configData = data.data.conf.web_desktop;
}
const sceneName = configData.sceneName;
const version = configData.version;
const bondleUrl = configData.bondleUrl;
this.loadBundle(sceneName, version, bondleUrl);
loadOnlineBundle(bundleName, callback = null) {
if (this.IS_BUNDLE_LOADING) {
return;
}
this.IS_BUNDLE_LOADING = true;
console.log(' in loadOnlineBundle')
this.callNetworkApiGet(`/api/template/v2/${bundleName}`, {}, (datastr) => {
const data = JSON.parse(datastr).data;
let sceneName, version, bondleUrl = "";
const templateBaseUrl = `${this.DOMAIN}h5template/${data.name}/v${data.last_version}`;
this.getConfigInfo(templateBaseUrl, (conf) => {
if (cc.sys.os == cc.sys.OS_IOS) {
sceneName = conf.ios.sceneName;
version = conf.ios.version;
bondleUrl = `${templateBaseUrl}/ios/${conf.ios.sceneName}`;
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
sceneName = conf.android.sceneName;
version = conf.android.version;
bondleUrl = `${templateBaseUrl}/android/${conf.ios.sceneName}`;
} else {
sceneName = conf.android.sceneName;
version = "";
bondleUrl = `${templateBaseUrl}/web_desktop`;
}
this.loadBundle(sceneName, version, bondleUrl, callback);
});
});
}
currentBundleInfo = null;
reloadBundle() {
if (this.IS_BUNDLE_LOADING) {
return;
}
this.IS_BUNDLE_LOADING = true;
const { sceneName, version, bondleUrl } = this.currentBundleInfo;
this.loadBundle(sceneName, version, bondleUrl);
}
async loadBundle(sceneName, version, bondleUrl) {
async loadBundle(sceneName, version, bondleUrl, callback = null) {
if (this.oldSceneName) {
await this.checkRotateScreen(this.oldSceneName, sceneName);
}
this.assetList = [];
this.textureList = [];
this.assetObj = {};
this.atlasList = [];
this.nodeList = [];
this.getDragonDisplayAssetList(cc.find('Canvas'));
this.currentBundleInfo = { sceneName, version, bondleUrl };
this.showMask();
this.showWaitingLetters();
cc.audioEngine.stopAll();
const oldSceneName = this.currentBundleInfo?.sceneName;
const engineInfo = await this.getEngineInfo();
const { isChanged } = JSON.parse(engineInfo);
if (isChanged) {
await this.checkRotateScreen(oldSceneName, sceneName);
this.setNodeListVisible();
// 手机端强制垃圾回收
if (cc.sys.os == cc.sys.OS_IOS || cc.sys.os == cc.sys.OS_ANDROID) {
cc.sys.garbageCollect();
}
cc.assetManager.loadBundle(bondleUrl, { version: version }, async (err, bundle) => {
bundle.loadScene(sceneName, null, null, (err, scene) => {
cc.audioEngine.stopAll();
this.courseOpenTimeStamp = Date.now();
cc.director.runScene(scene, null, () => {
console.log('sceneName = ' + sceneName);
const canvas = cc.find('Canvas');
const middleLayer = cc.find('middleLayer');
cc.find('middleLayer/ExitBtn').active = true;
this.hideWaitingLetters();
canvas.getComponent(cc.Widget).updateAlignment();
middleLayer.scale = canvas.width / middleLayer.width;
// this.showLog('middleLayer.scale = ' + middleLayer.scale);
// 挂载清洁骨骼机制节点
const destroyer = cc.instantiate(cc.find('middleLayer/Destroyer'));
destroyer.parent = cc.find('Canvas');
destroyer.active = true;
// 手机端强制垃圾回收
if (cc.sys.os == cc.sys.OS_IOS || cc.sys.os == cc.sys.OS_ANDROID) {
cc.sys.garbageCollect();
}
callback && callback();
this.IS_BUNDLE_LOADING = false;
this.oldSceneName = sceneName;
});
});
});
}
setNodeListVisible() {
const setParentVisible = (n) => {
n.active = true;
if (n.parent) {
setParentVisible(n.parent);
}
}
this.nodeList.forEach(node => {
setParentVisible(node);
});
}
getUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
checkRotateScreen(oldSceneName: string, newSceneName: string) {
const sceneNameList = ['op_16'];
const sceneNameList = ["cc_mz_link_write_03"];
if (sceneNameList.includes(oldSceneName) || sceneNameList.includes(newSceneName)) {
return new Promise((resolve, reject) => {
if (sceneNameList.includes(newSceneName)) {
......@@ -172,48 +313,64 @@ export abstract class middleLayerBase extends cc.Component {
courses = null;
courseIndex = 0;
courseItem = null;
loadOnlineCourseWare(courseId, linkFlag = false) {
courseOpenTimeStamp = null;
loadOnlineCourseWare(courseId, linkFlag = false, coursewareId = null) {
if (this.IS_BUNDLE_LOADING) {
return;
}
this.IS_BUNDLE_LOADING = true;
this.showWaitingLetters();
let api = `/api/courseware/v1/${courseId}/list`;
let api = `/api/courseware/v2/${courseId}/list`;
if (linkFlag === true) {
api = `/api/courseware/v1/${courseId}/eq/level/list`;
api = `/api/courseware/v2/${courseId}/eq/level/list`;
}
this.callNetworkApiGet(api, {}, (datastr) => {
const data = JSON.parse(datastr);
if (data.rows && data.rows.length > 0) {
this.courses = data.rows;
this.courseIndex = data.index || 0;
if (coursewareId) {
this.courseIndex = data.rows.findIndex(item => item.id == coursewareId);
} else {
this.courseIndex = data.index || 0;
}
this.courseItem = data.rows[this.courseIndex];
} else {
this.hideWaitingLetters();
this.showTips(`内容还未制作`);
this.IS_BUNDLE_LOADING = false;
return;
}
if (this.courses && this.courses.length > 1 && this.courseIndex <= this.courses.length - 1) {
}
if (this.courseIndex > 0) {
}
this.reWriteAir();
this.loadPageBundle();
this.onCourseWareLoaded();
this.loadPageBundle(() => {
});
});
}
loadPageBundle() {
loadPageBundle(callback = null) {
console.log(" in loadPageBundle");
let sceneName, version, bondleUrl = "";
if (cc.sys.os == cc.sys.OS_IOS) {
sceneName = this.courseItem.conf.ios.sceneName;
version = this.courseItem.conf.ios.version;
bondleUrl = this.courseItem.conf.ios.bondleUrl;
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
sceneName = this.courseItem.conf.android.sceneName;
version = this.courseItem.conf.android.version;
bondleUrl = this.courseItem.conf.android.bondleUrl;
} else {
sceneName = this.courseItem.conf.web_desktop.sceneName;
version = this.courseItem.conf.web_desktop.version;
bondleUrl = this.courseItem.conf.web_desktop.bondleUrl;
}
const templateBaseUrl = `${this.DOMAIN}h5template/${this.courseItem.template_name}/v${this.courseItem.last_version}`;
this.getConfigInfo(templateBaseUrl, (conf) => {
this.loadBundle(sceneName, version, bondleUrl);
if (cc.sys.os == cc.sys.OS_IOS) {
sceneName = conf.ios.sceneName;
version = conf.ios.version;
bondleUrl = `${templateBaseUrl}/ios/${conf.ios.sceneName}`;
} else if (cc.sys.os == cc.sys.OS_ANDROID) {
sceneName = conf.android.sceneName;
version = conf.android.version;
bondleUrl = `${templateBaseUrl}/android/${conf.ios.sceneName}`;
} else {
sceneName = conf.android.sceneName;
version = "";
bondleUrl = `${templateBaseUrl}/web_desktop`;
}
this.loadBundle(sceneName, version, bondleUrl, callback);
});
}
goPrePage() {
this.goTarIndexPage(this.courseIndex - 1);
}
......@@ -221,18 +378,26 @@ export abstract class middleLayerBase extends cc.Component {
this.goTarIndexPage(this.courseIndex + 1);
}
goTarIndexPage(index) {
if (this.IS_BUNDLE_LOADING) {
return;
}
this.IS_BUNDLE_LOADING = true;
if (!this.courses || index == this.courseIndex || index < 0 || index > this.courses.length - 1) {
this.IS_BUNDLE_LOADING = false;
return;
}
this.showWaitingLetters();
(<any>window).courseware.freeAllOcMethod();
this.courseIndex = index;
this.courseItem = this.courses[this.courseIndex];
this.loadPageBundle();
}
showTips(str) {
showTips(str: string) {
const tipsNode = new cc.Node();
tipsNode.parent = cc.find('Canvas');
tipsNode.zIndex = 100;
......@@ -259,11 +424,76 @@ export abstract class middleLayerBase extends cc.Component {
}
log(str) {
cc.log(str);
console.log(str);
}
async clearDragonDisplayAssetList() {
if (this.atlasList.length == 0) {
return;
}
this.setNodeListVisible();
for (let i=0; i<this.atlasList.length; i++) {
const atlas = this.atlasList[i];
const asset = this.assetList[i];
const texture = this.textureList[i];
const node = this.nodeList[i];
atlas.decRef();
cc.assetManager.releaseAsset(atlas);
atlas.destroy();
asset.decRef();
cc.assetManager.releaseAsset(asset);
asset.destroy();
texture.decRef();
}
}
assetObj = null;
nodeList = null;
atlasList = null;
assetList = null;
textureList = null;
getDragonDisplayAssetList(node) {
const dragonDisplay = node.getComponent(dragonBones.ArmatureDisplay);
if (dragonDisplay) {
const atlas = dragonDisplay.dragonAtlasAsset;
const asset = dragonDisplay.dragonAsset;
if (atlas && atlas.texture) {
if (atlas.texture.nativeUrl.includes('h5template')) {
node.children.forEach(child => {
this.getDragonDisplayAssetList(child);
});
return;
}
this.nodeList.push(node);
this.atlasList.push(atlas);
this.assetList.push(asset);
this.textureList.push(atlas.texture);
}
}
node.children.forEach(child => {
this.getDragonDisplayAssetList(child);
});
}
}
toCleanParent() {
const canvas = cc.find("Canvas");
this.nodeList.forEach(node => {
node.parent = canvas;
});
}
function asyncDelay(arg0: number) {
throw new Error("Function not implemented.");
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment