import { _decorator, Component, Node } from 'cc';
import { UIBase } from '../../Framework/UI/UIBase';
import { World } from './World';

const { ccclass, property } = _decorator;

/**
 * UIGame 游戏主界面
 * 显示游戏UI和世界场景
 */
@ccclass('UIGame')
export class UIGame extends UIBase {
    @property(Node)
    worldRoot: Node = null;

    protected onLoad(): void {
        console.log('[UIGame] onLoad');
    }

    protected onEnable(): void {
        console.log('[UIGame] onEnable');
    }

    protected onDisable(): void {
        console.log('[UIGame] onDisable');
    }

    protected onDestroy(): void {
        console.log('[UIGame] onDestroy');
    }

    /**
     * 获取 UI 预制体路径
     */
    public onGetUrl(): string {
        return 'res://UI/UIGame';
    }

    /**
     * 获取世界根节点
     */
    public getWorldRoot(): Node {
        return this.worldRoot;
    }
}
