Ejemplo n.º 1
0
        /// <summary>
        /// 加载数据表
        /// </summary>
        /// <param name="dataTableName">数据表</param>
        private async CFVoid LoadDataTable(string dataTableName)
        {
            DataTableProvider dataTableBase = CentorPivot.This.GetComponent <DataTableComponent>().CreateDataTable(dataTableName);

            bool status = await dataTableBase.ReadDataAsync(GlobalPath.Hoftix.GetDataTableResources(dataTableBase.Name), ConstData.Priority.DataTable, AssetCategory.DataTable, null);

            if (status)
            {
                m_CurrPreloadCount += 1;
                Log.Info("Load data table '{0}' OK.", dataTableBase.Name, LogCategory.Resource);
            }
            else
            {
                Log.Error("Can not load data table '{0}' error .", dataTableBase.Name, LogCategory.Resource);
            }
        }
Ejemplo n.º 2
0
        private async void OnStartPreloadCallBack(TimeAction timeAction)
        {
            DataTableProvider dataTableBase = (DataTableProvider)CentorPivot.This.GetComponent <DataTableComponent>().ICreateDataTable <DRDataTable>("DataTable");

            bool status = await dataTableBase.ReadDataAsync(GlobalPath.Hoftix.GetDataTableResources(dataTableBase.Name), ConstData.Priority.DataTable, AssetCategory.DataTable, null);

            if (status)
            {
                //1、获取要加载的表格
                AwaitGetDataTableInfo();
            }

            //2、获取要加载的热更CODE
            AwaitGetHotfixCode();

            //3、获取要加载的多语言字典信息
            AwaitGetDict();

            //4、获取要加载的shader信息
            AwaitGetShader();

            //5、获取要加载的fui信息
            AwaitGetFUIPackage();

            //当前+阶后的 预设进度值(计算值)
            timeAction.CFParams.FloatParam1 = 0f;
            //当前下载进度(计算值)
            timeAction.CFParams.FloatParam2 = 0f;
            //当前下载进度(UI)
            timeAction.CFParams.FloatParam3 = 0f;
            //初始的读条自增值(计算值)
            timeAction.CFParams.FloatParam5 = 0.01f;

            bool needUpdateResources = ProcedureComponent.This.GetProcedure <ProcedureResource>().OnOuterApi_11();

            L0_Text.This.m_MCycle_LoadRes.visible = true;

            //如果需要更新 则打开进度条弹窗
            if (needUpdateResources)
            {
                //资源更新完毕,正在校验资源…
                L0_Text.This.m_Text_Mseg
                .SetGTextByCode("Text_Mseg_007");

                //客户端资源更新完毕,正在校验资源
                L1_Loading.This.m_Text_ParDesc
                .SetGTextByCode("Text_ParDesc_002");

                L1_Loading.This
                .m_LoginPBar.value = 0;

                //selectedIndex = 2 进度条加载
                Block_Layout.This.m_Ctrl_Layout.selectedIndex = 1;
            }
            else
            {
                //信息获取完毕,正在校验资源...
                L0_Text.This.m_Text_Mseg
                .SetGTextByCode("Text_Mseg_006");

                L1_Loading.This
                .m_LoginPBar.value = 0;

                //selectedIndex = 0 默认
                Block_Layout.This.m_Ctrl_Layout.selectedIndex = 0;
            }
        }