Commit d631d85a authored by 李维's avatar 李维

添加返回按钮

parent 4c4991fe
......@@ -17,7 +17,7 @@
"__id__": 2
},
{
"__id__": 76
"__id__": 82
}
],
"_active": false,
......@@ -109,18 +109,21 @@
},
{
"__id__": 51
},
{
"__id__": 57
}
],
"_active": true,
"_components": [
{
"__id__": 73
"__id__": 79
},
{
"__id__": 74
"__id__": 80
},
{
"__id__": 75
"__id__": 81
}
],
"_prefab": null,
......@@ -2616,22 +2619,244 @@
},
{
"__type__": "cc.Node",
"_name": "res",
"_name": "btn_return",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 52
},
{
"__id__": 53
},
{
"__id__": 54
},
{
"__id__": 55
}
],
"_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": "adwcrsY+5DmZ+f4TqemJn8"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "12b22d6d-6d59-4ad9-b5e2-0a36097fd727"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "38oaVhpbJI9LtCF0mhK5g1"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
},
"_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": "95JcXRx15IRroa9+bIN1NF"
},
{
"__type__": "4f4e5FcR1NAzIs/kZx8de8z",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
},
"_enabled": true,
"_id": "a1qrUs4ihPNqux+DRlQ3bh"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 56
}
],
"_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": "6a4rA1RTNJWI0Dv0Q090CE"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 51
},
"component": "",
"_componentId": "4f4e5FcR1NAzIs/kZx8de8z",
"handler": "handleClickBack",
"customEventData": ""
},
{
"__type__": "cc.Node",
"_name": "res",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 58
},
{
"__id__": 59
},
{
"__id__": 62
}
],
"_active": false,
"_components": [],
"_prefab": null,
......@@ -2687,7 +2912,7 @@
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 51
"__id__": 57
},
"_children": [],
"_active": true,
......@@ -2745,11 +2970,11 @@
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 51
"__id__": 57
},
"_children": [
{
"__id__": 54
"__id__": 60
}
],
"_active": true,
......@@ -2807,13 +3032,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 53
"__id__": 59
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 55
"__id__": 61
}
],
"_prefab": null,
......@@ -2869,7 +3094,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
"__id__": 60
},
"_enabled": true,
"_materials": [],
......@@ -2897,32 +3122,32 @@
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 51
"__id__": 57
},
"_children": [
{
"__id__": 57
"__id__": 63
},
{
"__id__": 59
"__id__": 65
},
{
"__id__": 61
"__id__": 67
},
{
"__id__": 63
"__id__": 69
},
{
"__id__": 65
"__id__": 71
},
{
"__id__": 67
"__id__": 73
},
{
"__id__": 69
"__id__": 75
},
{
"__id__": 71
"__id__": 77
}
],
"_active": true,
......@@ -2980,13 +3205,13 @@
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 58
"__id__": 64
}
],
"_prefab": null,
......@@ -3042,7 +3267,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 57
"__id__": 63
},
"_enabled": true,
"_clip": {
......@@ -3061,13 +3286,13 @@
"_name": "出现",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 60
"__id__": 66
}
],
"_prefab": null,
......@@ -3123,7 +3348,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 59
"__id__": 65
},
"_enabled": true,
"_clip": {
......@@ -3142,13 +3367,13 @@
"_name": "正确",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 62
"__id__": 68
}
],
"_prefab": null,
......@@ -3204,7 +3429,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
"__id__": 67
},
"_enabled": true,
"_clip": {
......@@ -3223,13 +3448,13 @@
"_name": "错误泡泡爆炸",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 64
"__id__": 70
}
],
"_prefab": null,
......@@ -3285,7 +3510,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
"__id__": 69
},
"_enabled": true,
"_clip": {
......@@ -3304,13 +3529,13 @@
"_name": "按钮",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 66
"__id__": 72
}
],
"_prefab": null,
......@@ -3366,7 +3591,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 65
"__id__": 71
},
"_enabled": true,
"_clip": {
......@@ -3385,13 +3610,13 @@
"_name": "大星",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 68
"__id__": 74
}
],
"_prefab": null,
......@@ -3447,7 +3672,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 67
"__id__": 73
},
"_enabled": true,
"_clip": {
......@@ -3466,13 +3691,13 @@
"_name": "题数",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 70
"__id__": 76
}
],
"_prefab": null,
......@@ -3528,7 +3753,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
"__id__": 75
},
"_enabled": true,
"_clip": {
......@@ -3547,13 +3772,13 @@
"_name": "撒花",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 62
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 72
"__id__": 78
}
],
"_prefab": null,
......@@ -3609,7 +3834,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 71
"__id__": 77
},
"_enabled": true,
"_clip": {
......@@ -3695,13 +3920,13 @@
},
"_children": [
{
"__id__": 77
"__id__": 83
}
],
"_active": true,
"_components": [
{
"__id__": 81
"__id__": 87
}
],
"_prefab": null,
......@@ -3757,17 +3982,17 @@
"_name": "Star",
"_objFlags": 0,
"_parent": {
"__id__": 76
"__id__": 82
},
"_children": [
{
"__id__": 78
"__id__": 84
}
],
"_active": false,
"_components": [
{
"__id__": 80
"__id__": 86
}
],
"_prefab": null,
......@@ -3823,13 +4048,13 @@
"_name": "StarBig",
"_objFlags": 0,
"_parent": {
"__id__": 77
"__id__": 83
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 79
"__id__": 85
}
],
"_prefab": null,
......@@ -3885,7 +4110,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
"__id__": 84
},
"_enabled": true,
"_materials": [
......@@ -3917,7 +4142,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
"__id__": 83
},
"_enabled": true,
"_materials": [
......@@ -3949,7 +4174,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 76
"__id__": 82
},
"_enabled": true,
"_materials": [
......
// 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": "4f4e515c-4753-40cc-8b3f-919c7c75ef33",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "861f1bbe-7e01-47a9-8ace-f6f1d4af7242",
"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": "12b22d6d-6d59-4ad9-b5e2-0a36097fd727",
"rawTextureUuid": "861f1bbe-7e01-47a9-8ace-f6f1d4af7242",
"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