Exemple #1
0
        private TableLoader GetTableLoaderByName(string name)
        {
            TableLoader table = null;

            if (string.IsNullOrEmpty(name))
            {
                GameLog.Error("ERROR!!!----TableManager:GetTableLoaderByName----name is null!!!");
                return(table);
            }
            if (!_tableLoaderList.ContainsKey(name))
            {
                GameLog.Error("ERROR!!!----TableManager:GetTableLoaderByName----TableConfig don't have table which name is {0}!!!", name);
                return(table);
            }

            if (_tableLoaderList.TryGetValue(name, out table))
            {
                if (table.TableDataDict == null)
                {
                    table.Load();
                }
            }
            else
            {
                GameLog.Error("ERROR!!!----TableManager:GetTableLoaderByName----TableLoaderList Get Fail!!! name = {0}", name);
            }

            return(table);
        }
Exemple #2
0
        private void LoadTableConfig()
        {
            byte[]     data       = ResourceManager.Instance.LoadTableConfig();
            ByteBuffer byteBuffer = new ByteBuffer(data);

            tableConfig = TableConfigTable.GetRootAsTableConfigTable(byteBuffer);
            for (int i = 0; i < tableConfig.DataLength; i++)
            {
                TableConfigVO tableItem = (TableConfigVO)tableConfig.Data(i);
                TableLoader   loader    = new TableLoader(tableItem);
                _tableLoaderList.Add(tableItem.Name, loader);
            }
            StartLoadTable();
        }