hch
7 天以前 98562babc4cb77c499f6c943b634a26b38e3d041
Main/Config/ConfigBase.cs
@@ -87,38 +87,39 @@
        }
        for (int i = 3; i < lines.Length; i++)
        {
            string line = lines[i];
            var index = line.IndexOf("\t");
            if (index == -1)
            {
                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();
#if UNITY_EDITOR
                try
                {
#endif
                    m_dic.Add(key, config);
#if UNITY_EDITOR
                }
                catch (ArgumentException exception)
                {
                    Debug.LogError(typeof(T).Name + " 重复的key " + key + " " + exception.Message);
                }
#endif
                continue;
            }
        foreach (var cfg in m_dic.Values)
        {
            cfg.AllConfigLoadFinish();
            string strKey = line.Substring(0, index);
            T config = new T();
            U key = config.LoadKey(strKey);
            config.LoadConfig(line);
            config.OnConfigParseCompleted();
#if UNITY_EDITOR
            try
            {
#endif
                m_dic.Add(key, config);
#if UNITY_EDITOR
            }
            catch (ArgumentException exception)
            {
                Debug.LogError(typeof(T).Name + " 重复的key " + key + " " + exception.Message);
            }
#endif
        }
        // foreach (var cfg in m_dic.Values)
        // {
        //     cfg.AllConfigLoadFinish();
        // }
        isInit = true;
    }