From dc7922d80c1d133b6261b8af1d521567d2c0a35d Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 30 十月 2025 16:51:39 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
---
Main/Config/ConfigBase.cs | 71 +++++++++++++++++++----------------
1 files changed, 39 insertions(+), 32 deletions(-)
diff --git a/Main/Config/ConfigBase.cs b/Main/Config/ConfigBase.cs
index 6c9806c..e51fef1 100644
--- a/Main/Config/ConfigBase.cs
+++ b/Main/Config/ConfigBase.cs
@@ -7,12 +7,18 @@
public class ConfigBase<U, T> where T : ConfigBase<U, T>, new()
{
+ /// <summary>
+ /// 鏄惁璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ /// </summary>
+ public static bool visit = false;
+
static ConfigBase()
{
if (isInit)
{
return;
}
+
LazyInit();
}
@@ -38,11 +44,11 @@
return null;
}
- public static void ForceRelease()
- {
- m_dic.Clear();
- isInit = false;
- }
+ // public static void ForceRelease()
+ // {
+ // m_dic.Clear();
+ // isInit = false;
+ // }
public static List<U> GetKeys()
{
@@ -81,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 + " 閲嶅鐨刱ey " + 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 + " 閲嶅鐨刱ey " + key + " " + exception.Message);
+ }
+#endif
}
+
+ // foreach (var cfg in m_dic.Values)
+ // {
+ // cfg.AllConfigLoadFinish();
+ // }
+
isInit = true;
}
--
Gitblit v1.8.0