From 8fdbb6eed9040a89b233068eadc32d9b635a162c Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 03 七月 2025 17:13:47 +0800
Subject: [PATCH] 18 子 2D卡牌客户端搭建 / 2D卡牌客户端搭建 配置表问题

---
 Main/Config/ConfigManager.cs |   38 ++++++++++++++++++++++++++++++--------
 1 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index ff149d3..40602b6 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -34,31 +34,43 @@
 
         // 鍔犺浇閰嶇疆鏂囦欢
         int totalConfigs = 17;
-        Type[] configTypes = new Type[] {
+        List<Type> configTypes = new List<Type>() {
             typeof(ChestsAwardConfig),
             typeof(CTGConfig),
             typeof(DirtyWordConfig),
             typeof(EquipGSParamConfig),
+            typeof(ItemConfig),
             typeof(NPCConfig),
             typeof(NPCExConfig),
             typeof(OrderInfoConfig),
+            typeof(PlayerFaceConfig),
             typeof(PlayerFacePicStarConfig),
             typeof(PlayerFaceStarConfig),
-            typeof(PlayerLVConfig),
             typeof(StoreConfig),
             typeof(SuccessConfig),
             typeof(SysInfoConfig),
             typeof(TitleStarUpConfig),
-            typeof(TreasureItemLibConfig),
             typeof(TreasureSetConfig),
             typeof(XBGetItemConfig)
         };
 
 #if UNITY_EDITOR
+        HashSet<Type> configHashSet = new HashSet<Type>();
+        if (System.IO.File.Exists(Application.dataPath + "/fastConfig.txt"))
+        {
+            string[] strConfgsArr = System.IO.File.ReadAllLines(Application.dataPath + "/fastConfig.txt");
+            foreach (string str in strConfgsArr)
+            {
+                Type tpy = Type.GetType(str);
+                configHashSet.Add(tpy);
+            }
+        }
+        //  缂栬緫鍣ㄤ笅鍔犲叆 璇勪及鍔犺浇鏃跺父
+        configTypes.AddRange(configHashSet);
         List<string> fastName = new List<string>();
 #endif
         // 閫愪釜鍔犺浇閰嶇疆骞舵洿鏂拌繘搴�
-        for (int i = 0; i < configTypes.Length; i++)
+        for (int i = 0; i < configTypes.Count; i++)
         {
             var sw = System.Diagnostics.Stopwatch.StartNew();
             LoadConfigByType(configTypes[i]);
@@ -78,6 +90,16 @@
         }
 #if UNITY_EDITOR
         System.IO.File.WriteAllText(Application.dataPath + "/fastConfig.txt", string.Join("\n", fastName));
+
+        //鍔犺浇瀹屽悗鍗歌浇
+        foreach (var configType in configTypes)
+        {
+            var methodInfo = configType.GetMethod("ForceRelease", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
+            if (methodInfo != null)
+            {
+                methodInfo.Invoke(null, null);
+            }
+        }
 #endif
 
         // 鍔犺浇瀹屾垚鍚庤缃甶sLoadFinished涓簍rue
@@ -175,18 +197,20 @@
         ClearConfigDictionary<DirtyWordConfig>();
         // 娓呯┖ EquipGSParamConfig 瀛楀吀
         ClearConfigDictionary<EquipGSParamConfig>();
+        // 娓呯┖ ItemConfig 瀛楀吀
+        ClearConfigDictionary<ItemConfig>();
         // 娓呯┖ NPCConfig 瀛楀吀
         ClearConfigDictionary<NPCConfig>();
         // 娓呯┖ NPCExConfig 瀛楀吀
         ClearConfigDictionary<NPCExConfig>();
         // 娓呯┖ OrderInfoConfig 瀛楀吀
         ClearConfigDictionary<OrderInfoConfig>();
+        // 娓呯┖ PlayerFaceConfig 瀛楀吀
+        ClearConfigDictionary<PlayerFaceConfig>();
         // 娓呯┖ PlayerFacePicStarConfig 瀛楀吀
         ClearConfigDictionary<PlayerFacePicStarConfig>();
         // 娓呯┖ PlayerFaceStarConfig 瀛楀吀
         ClearConfigDictionary<PlayerFaceStarConfig>();
-        // 娓呯┖ PlayerLVConfig 瀛楀吀
-        ClearConfigDictionary<PlayerLVConfig>();
         // 娓呯┖ StoreConfig 瀛楀吀
         ClearConfigDictionary<StoreConfig>();
         // 娓呯┖ SuccessConfig 瀛楀吀
@@ -195,8 +219,6 @@
         ClearConfigDictionary<SysInfoConfig>();
         // 娓呯┖ TitleStarUpConfig 瀛楀吀
         ClearConfigDictionary<TitleStarUpConfig>();
-        // 娓呯┖ TreasureItemLibConfig 瀛楀吀
-        ClearConfigDictionary<TreasureItemLibConfig>();
         // 娓呯┖ TreasureSetConfig 瀛楀吀
         ClearConfigDictionary<TreasureSetConfig>();
         // 娓呯┖ XBGetItemConfig 瀛楀吀

--
Gitblit v1.8.0