示例#1
0
        public static TDTableMetaData GetLanguageMetaData()
        {
            string key = I18NMgr.S.langugePrefix;

            string tableName = FormatTableName(TDLanguageTable.metaData.TableName, key);

            if (!FileMgr.S.FileExists(TableReadThreadWork.GetTableFilePath(tableName)))
            {
                return(TDLanguageTable.metaData);
            }

            return(new TDTableMetaData(TDLanguageTable.Parse, tableName));
        }
示例#2
0
        /// <summary>
        /// 预先读取Language Const表
        /// </summary>
        /// <returns></returns>
        public IEnumerator PreReadAll(Action onLoadFinish)
        {
            TableReadThreadWork readWork = CreateTableReadJobs(TableConfig.preLoadTableArray);

            readWork.Start();
            while (readWork.m_IsDone == false)
            {
                yield return(0);
            }

            if (onLoadFinish != null)
            {
                onLoadFinish();
            }
            yield return(0);
        }
示例#3
0
        public IEnumerator ReadAll(TDTableMetaData[] dataArray, Action onLoadFinish)
        {
            m_IsLoading = true;
            TableReadThreadWork readWork = CreateTableReadJobs(dataArray);

            readWork.Start();
            while (readWork.m_IsDone == false)
            {
                m_TableReadProgress = readWork.finishedCount * 1.0f / readWork.readMaxCount * 1.0f;
                yield return(0);
            }

            m_IsLoading = false;

            if (onLoadFinish != null)
            {
                onLoadFinish();
            }
            yield return(0);
        }
示例#4
0
        private TableReadThreadWork CreateTableReadJobs(TDTableMetaData[] tableArrayA, TDTableMetaData[] tableArrayB = null)
        {
            TableReadThreadWork readWork = new TableReadThreadWork();

            if (tableArrayA != null)
            {
                for (int i = 0; i < tableArrayA.Length; ++i)
                {
                    readWork.AddJob(tableArrayA[i]);
                }
            }

            if (tableArrayB != null)
            {
                for (int i = 0; i < tableArrayB.Length; ++i)
                {
                    readWork.AddJob(tableArrayB[i]);
                }
            }

            return(readWork);
        }