import { _decorator, Component, Node, director } from "cc";
const { ccclass, property } = _decorator;

@ccclass("start")
export class start extends Component {
    /* class member could be defined like this */
    // dummy = '';

    /* use `property` decorator if your want the member to be serializable */
    // @property
    // serializableDummy = 0;

    //获取到继续游戏按钮
    @property(Node)
    resumeButton:Node=null;

    start () {
        // Your initialization goes here.
    }

    //开始游戏
    public startGame()
    {
        cc.director.loadScene('game');
    }

    //退出游戏
    public exitGame()
    {
        cc.game.end();
    }

    //游戏暂停
    public pauseGame()
    {
        cc.director.pause();
        this.resumeButton.active=true;
    }

    //继续游戏
    public resumeGame()
    {
        cc.director.resume();
        this.resumeButton.active=false;
    }

    //主菜单
    public menu()
    {
        cc.director.loadScene('start');
    }

    // update (deltaTime: number) {
    //     // Your update function goes here.
    // }
}
