| | |
| | |
|
| | | public static void Init(string[] lines)
|
| | | {
|
| | | m_dic.Clear();
|
| | | if (isInit)
|
| | | {
|
| | | Debug.LogError("重复加载表格 类型 " + typeof(T).Name);
|
| | | return;
|
| | | }
|
| | |
|
| | | for (int i = 3; i < lines.Length; i++)
|
| | | {
|
| | | string line = lines[i];
|
| | | var index = line.IndexOf("\t");
|
| | | if (index == -1)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | string line = lines[i];
|
| | | var index = line.IndexOf("\t");
|
| | | if (index == -1)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | string strKey = line.Substring(0, index);
|
| | | T config = new T();
|
| | | U key = config.LoadKey(strKey);
|
| | | config.LoadConfig(line);
|
| | | config.OnConfigParseCompleted();
|
| | | string strKey = line.Substring(0, index);
|
| | | T config = new T();
|
| | | U key = config.LoadKey(strKey);
|
| | | config.LoadConfig(line);
|
| | | config.OnConfigParseCompleted();
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | try
|
| | | {
|
| | | #endif
|
| | | m_dic.Add(key, config);
|
| | | m_dic.Add(key, config);
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (ArgumentException exception)
|
| | | {
|
| | | Debug.LogError(typeof(T).Name + " 重复的key " + key + " " + exception.Message);
|
| | | }
|
| | | }
|
| | | catch (ArgumentException exception)
|
| | | {
|
| | | Debug.LogError(typeof(T).Name + " 重复的key " + key + " " + exception.Message);
|
| | | }
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
|
| | | foreach (var cfg in m_dic.Values)
|
| | | {
|