Commit 93cd0443 authored by Tt's avatar Tt

退出按钮

parent 6427b047
This diff is collapsed.
......@@ -81,6 +81,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node)
btn_laba: cc.Node = null;
@property(cc.Node)
btn_return: cc.Node = null;
@property(cc.Node)
btn_record: cc.Node = null;
@property(cc.Node)
btn_recording: cc.Node = null;
......@@ -121,9 +123,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.find("layout_info/label_title", this.node).getComponent(cc.Label).string = Game.getIns().title;
}
}
exitGame() {
const middleLayer = cc.find('middleLayer')?.getComponent('middleLayer');
if (middleLayer) {
// 有些模板需要在返回时上报数据,直接把数据作为参数传入就可以了
middleLayer.exitGame(null);//this.resData
} else {
console.log("==触发返回事件==");
}
}
initEvent() {
this.btn_laba.on(cc.Node.EventType.TOUCH_END, this.playLaba, this);
this.btn_return.on(cc.Node.EventType.TOUCH_END, this.exitGame, this);
cc.find("btn_close", this.layout_final).on(cc.Node.EventType.TOUCH_END, this.onCloseFinal, this);
cc.find("btn_restart", this.layout_final).on(cc.Node.EventType.TOUCH_END, this.onRestart, this);
pg.event.on("game_start", () => {
......
{
"ver": "2.3.5",
"uuid": "99d3450e-9cac-4fac-98c5-815a4f9b2b1f",
"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": "0072fed4-a751-4c0f-a8fa-178862fd46d1",
"rawTextureUuid": "99d3450e-9cac-4fac-98c5-815a4f9b2b1f",
"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