
import { _decorator, Component, director, profiler} from 'cc';
import { audioMgr } from '../core/manager/AudioManager';
import { csvMgr } from '../core/csv/CsvManager';
import { Logger } from '../core/extend/Logger';
import { bundleMgr } from '../core/manager/BundleManager';
import { settingData } from '../user/SettingData';
import Data from '../core/manager/Data';
import { uiMgr } from '../core/manager/UIManager';
import platformSystem from '../platform/platformSystem';
import BusyLoadingManager from '../core/manager/BusyLoadingManager';
import { ResUtil } from '../core/utils/ResUtil';
const { ccclass, property } = _decorator;

@ccclass('Loading')
export class Loading extends Component {
    async start() {
        //关闭FPS展示
        profiler.hideStats();
        //先加载配置资源包
        await bundleMgr.preloadConfigAllRes();
        //加载音效
        await audioMgr.initialize();
        //调用事例 加载所有CSV表
        await csvMgr.loadAll();
        BusyLoadingManager.ins;
        //设置
        settingData.loadFromCache();
        //数据加载
        Data.loadData();
        //初始化平台接口
        platformSystem.initialize();
        //启动场景
        ResUtil.enteScene("main")
    }
}

