import { ui } from "../ui/layaMaxUI";
import { ViewManager, ViewType } from "./ViewManager";
import { DispatcherManager, StageState } from "../GameUtils/EventManager";
export class HomeView extends ui.HomeViewUI{
    private static ins:HomeView;
    constructor(){
        super();
        HomeView.ins = this;
    }
    public static get Instance():HomeView{
        if(HomeView.ins == null){
            return new HomeView();
        }
        return HomeView.ins;
    }
    OnShow(){
        console.log("主界面");
        this.RegButton();
    }
    RegButton(){
        this.StartBtn.clickHandler = new Laya.Handler(this,this.Start);
    }
    Start(){
        ViewManager.Instance.ShowView(ViewType.InGameView);
        DispatcherManager.StageTrigger(StageState.Start);
    }
    OnHide(){
        
    }
}