import { _decorator, director } from 'cc';
import { ModulerBase } from '../../GameFrameWork/ModulerBase';
const { ccclass, property } = _decorator;

@ccclass('Pause')
export class Pause extends ModulerBase {
    protected onStart() {
        this.onBtnClick("_back", this._onBtnBack, this);
        this.onBtnClick("_continue", this._onContinue, this);
        this.onBtnClick("_btnPause", this._onPause, this)
    }

    private _onPause(){
        director.pause();
        this.getNode("_pause").active = true;
    }
    private _onBtnBack() {
        director.resume();
        this.getNode("_pause").active = false;
        director.preloadScene("StartScene");
        director.loadScene("StartScene");
    }
    private _onContinue(){
        this.getNode("_pause").active = false;
        director.resume();
    }
}


