// 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) {}
}
