Commit 22dab672 authored by 李维's avatar 李维

添加返回按钮

parent e9250568
...@@ -85,18 +85,21 @@ ...@@ -85,18 +85,21 @@
}, },
{ {
"__id__": 14 "__id__": 14
},
{
"__id__": 20
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 28 "__id__": 34
}, },
{ {
"__id__": 29 "__id__": 35
}, },
{ {
"__id__": 30 "__id__": 36
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -651,6 +654,228 @@ ...@@ -651,6 +654,228 @@
"_atlas": null, "_atlas": null,
"_id": "96PHvIBglCBJGFuVQXNadC" "_id": "96PHvIBglCBJGFuVQXNadC"
}, },
{
"__type__": "cc.Node",
"_name": "btn_return",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
},
{
"__id__": 16
},
{
"__id__": 17
},
{
"__id__": 18
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 139,
"height": 97
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-520.5,
261.5,
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": "48dVbxzopHK5cbE9dk/V8B"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "eb324efb-8998-44ff-b67d-41b8e5fe7a71"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f7KCTLoldGY6JRRNgIExdp"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 50,
"_right": 0,
"_top": 50,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "e4zpTFUS9IYLZuBglCwo+O"
},
{
"__type__": "72a801f9AxOeptW8Ot9ijdW",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_id": "ce3NmeqtZE+JM94Tqgw4oK"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 19
}
],
"_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": 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": "45Alt7O6dJu4vFQA0S9Cja"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 14
},
"component": "",
"_componentId": "72a801f9AxOeptW8Ot9ijdW",
"handler": "handleClickBack",
"customEventData": ""
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "res", "_name": "res",
...@@ -660,13 +885,13 @@ ...@@ -660,13 +885,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 15 "__id__": 21
}, },
{ {
"__id__": 22 "__id__": 28
}, },
{ {
"__id__": 25 "__id__": 31
} }
], ],
"_active": false, "_active": false,
...@@ -724,17 +949,17 @@ ...@@ -724,17 +949,17 @@
"_name": "img", "_name": "img",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 14 "__id__": 20
}, },
"_children": [ "_children": [
{ {
"__id__": 16 "__id__": 22
}, },
{ {
"__id__": 18 "__id__": 24
}, },
{ {
"__id__": 20 "__id__": 26
} }
], ],
"_active": true, "_active": true,
...@@ -792,13 +1017,13 @@ ...@@ -792,13 +1017,13 @@
"_name": "btn_play", "_name": "btn_play",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 15 "__id__": 21
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 17 "__id__": 23
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -854,7 +1079,7 @@ ...@@ -854,7 +1079,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 16 "__id__": 22
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
...@@ -882,13 +1107,13 @@ ...@@ -882,13 +1107,13 @@
"_name": "btn_replay", "_name": "btn_replay",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 15 "__id__": 21
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 25
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -944,7 +1169,7 @@ ...@@ -944,7 +1169,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 18 "__id__": 24
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
...@@ -972,13 +1197,13 @@ ...@@ -972,13 +1197,13 @@
"_name": "btn_stop", "_name": "btn_stop",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 15 "__id__": 21
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 21 "__id__": 27
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1034,7 +1259,7 @@ ...@@ -1034,7 +1259,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 20 "__id__": 26
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
...@@ -1062,11 +1287,11 @@ ...@@ -1062,11 +1287,11 @@
"_name": "font", "_name": "font",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 14 "__id__": 20
}, },
"_children": [ "_children": [
{ {
"__id__": 23 "__id__": 29
} }
], ],
"_active": true, "_active": true,
...@@ -1124,13 +1349,13 @@ ...@@ -1124,13 +1349,13 @@
"_name": "BRLNSDB", "_name": "BRLNSDB",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 22 "__id__": 28
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 24 "__id__": 30
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1186,7 +1411,7 @@ ...@@ -1186,7 +1411,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 23 "__id__": 29
}, },
"_enabled": true, "_enabled": true,
"_materials": [], "_materials": [],
...@@ -1217,11 +1442,11 @@ ...@@ -1217,11 +1442,11 @@
"_name": "audio", "_name": "audio",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 14 "__id__": 20
}, },
"_children": [ "_children": [
{ {
"__id__": 26 "__id__": 32
} }
], ],
"_active": true, "_active": true,
...@@ -1279,13 +1504,13 @@ ...@@ -1279,13 +1504,13 @@
"_name": "click", "_name": "click",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 25 "__id__": 31
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 33
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -1341,7 +1566,7 @@ ...@@ -1341,7 +1566,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 26 "__id__": 32
}, },
"_enabled": true, "_enabled": true,
"_clip": { "_clip": {
......
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const {ccclass, property} = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start () {
}
handleClickBack() {
const middleLayer = global["middleLayer"];
if (middleLayer) {
// 有些模板需要在返回时上报数据,直接把数据作为参数传入就可以了
middleLayer.exitGame({});
} else {
console.log("==触发返回事件==");
}
}
// update (dt) {}
}
{
"ver": "1.0.8",
"uuid": "72a80d5f-f40c-4e7a-9b56-f0eb7d8a3756",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9aa1a896-c5d3-460b-994e-0ab1d9669795",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 139,
"height": 97,
"platformSettings": {},
"subMetas": {
"btn_return": {
"ver": "1.0.4",
"uuid": "eb324efb-8998-44ff-b67d-41b8e5fe7a71",
"rawTextureUuid": "9aa1a896-c5d3-460b-994e-0ab1d9669795",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 139,
"height": 97,
"rawWidth": 139,
"rawHeight": 97,
"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