/// <summary> /// Do reload the dataTable file: Test /// </summary> void _ReloadAll(bool throwWhenDuplicatePrimaryKey, string customContent = null) { for (var j = 0; j < TabFilePaths.Length; j++) { var tabFilePath = TabFilePaths[j]; TableFile tableFile; if (customContent == null) { tableFile = DataTableModule.Get(tabFilePath, false); } else { tableFile = TableFile.LoadFromString(customContent); } using (tableFile) { foreach (var row in tableFile) { var pk = TestDataTable.ParsePrimaryKey(row); TestDataTable dataTable; if (!_dict.TryGetValue(pk, out dataTable)) { dataTable = new TestDataTable(row); _dict[dataTable.Id] = dataTable; } else { if (throwWhenDuplicatePrimaryKey) { throw new System.Exception(string.Format("DuplicateKey, Class: {0}, File: {1}, Key: {2}", this.GetType().Name, tabFilePath, pk)); } else { dataTable.Reload(row); } } } } } if (OnReload != null) { OnReload(); } ReloadCount++; UnityEngine.Debug.LogFormat("Reload dataTables: {0}, Row Count: {1}, Reload Count: {2}", GetType(), Count, ReloadCount); }