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

@ccclass("PlayPage")
export class PlayPage extends Component {
    @property({ type: Node })
    homepage: Node = null;

    private backButton: ButtonComponent = null;

    onLoad() {
        this.backButton = this.node.getChildByName("backBtn").getComponent(ButtonComponent);
        this.backButton.node.on("click", this.backBtnfun, this);
    }

    backBtnfun() {
        this.node.active = false;
        this.homepage.active = true;
    }
}
