Commit 95d718d1 authored by liujiangnan's avatar liujiangnan

feat: 返回功能

parent 04ae0705
...@@ -91,18 +91,24 @@ ...@@ -91,18 +91,24 @@
}, },
{ {
"__id__": 76 "__id__": 76
},
{
"__id__": 106
},
{
"__id__": 110
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 106 "__id__": 112
}, },
{ {
"__id__": 107 "__id__": 113
}, },
{ {
"__id__": 108 "__id__": 114
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3843,7 +3849,7 @@ ...@@ -3843,7 +3849,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 36.04, "width": 36.36,
"height": 45.36 "height": 45.36
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -3906,7 +3912,7 @@ ...@@ -3906,7 +3912,7 @@
"_isSystemFontUsed": false, "_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 1,
"_underlineHeight": 0, "_underlineHeight": 0,
"_N$horizontalAlign": 1, "_N$horizontalAlign": 1,
"_N$verticalAlign": 1, "_N$verticalAlign": 1,
...@@ -4238,7 +4244,7 @@ ...@@ -4238,7 +4244,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 36.04, "width": 40.04,
"height": 45.36 "height": 45.36
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -4301,7 +4307,7 @@ ...@@ -4301,7 +4307,7 @@
"_isSystemFontUsed": false, "_isSystemFontUsed": false,
"_spacingX": 0, "_spacingX": 0,
"_batchAsBitmap": false, "_batchAsBitmap": false,
"_styleFlags": 0, "_styleFlags": 1,
"_underlineHeight": 0, "_underlineHeight": 0,
"_N$horizontalAlign": 1, "_N$horizontalAlign": 1,
"_N$verticalAlign": 1, "_N$verticalAlign": 1,
...@@ -4827,6 +4833,282 @@ ...@@ -4827,6 +4833,282 @@
"_N$verticalScrollBar": null, "_N$verticalScrollBar": null,
"_id": "3cQSEK+wRMF6zytZxgazP+" "_id": "3cQSEK+wRMF6zytZxgazP+"
}, },
{
"__type__": "cc.Node",
"_name": "btn_return",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 107
},
{
"__id__": 108
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 131,
"height": 131
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-865,
450,
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": "472hDHJnJNLpiyLG6Rwshb"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 106
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b2f066b5-f1a9-4fdc-9364-796c91b086eb"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "ef7z9e/gRP8ZjP/O42odVV"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 106
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 109
}
],
"_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": {
"__id__": 106
},
"_id": "061nio61NCY59bxanik7WY"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "280c3rsZJJKnZ9RqbALVwtK",
"handler": "exitGame",
"customEventData": ""
},
{
"__type__": "cc.Node",
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 111
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 122,
"g": 141,
"b": 166,
"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": [
-731.027,
460.391,
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": "12SpAH9utA2722AS8pglUp"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 110
},
"_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": "f4yUauKIxCn5OxRjrUDInw"
},
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
"_name": "", "_name": "",
......
...@@ -549,9 +549,17 @@ cc.Class({ ...@@ -549,9 +549,17 @@ cc.Class({
onDestroy() { onDestroy() {
if(this.time1) { clearTimeout(this.time1); } if(this.time1) { clearTimeout(this.time1); }
// 被释放的时候上报成绩 },
onHomeworkFinish(this.data);
}, exitGame () {
const middleLayer = cc.find('middleLayer')?.getComponent('middleLayer');
if (middleLayer) {
// 有些模板需要在返回时上报数据,直接把数据作为参数传入就可以了
middleLayer.exitGame(this.data);
} else {
console.log("==触发返回事件==");
}
},
// called every frame // called every frame
......
{
"ver": "2.3.5",
"uuid": "93150b0c-6b0b-4efd-a9c7-c9de4ea89217",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 131,
"height": 131,
"platformSettings": {},
"subMetas": {
"btn_return": {
"ver": "1.0.4",
"uuid": "b2f066b5-f1a9-4fdc-9364-796c91b086eb",
"rawTextureUuid": "93150b0c-6b0b-4efd-a9c7-c9de4ea89217",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 131,
"height": 131,
"rawWidth": 131,
"rawHeight": 131,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment