Просмотр исходного кода

完善Reload dll跟Reload Config

tanghai 2 лет назад
Родитель
Сommit
2b523acbb3

+ 1 - 8
Unity/Assets/Scripts/Core/World/Module/Config/ConfigComponent.cs

@@ -25,10 +25,8 @@ namespace ET
         {
         }
 
-		public void ReloadOneConfig(string configName)
+		public void Reload(Type configType)
 		{
-			Type configType = EventSystem.Instance.GetType(configName);
-			
 			byte[] oneConfigBytes =
 					EventSystem.Instance.Invoke<GetOneConfigBytes, byte[]>(new GetOneConfigBytes() { ConfigName = configType.FullName });
 
@@ -38,11 +36,6 @@ namespace ET
 			
 			singleton.Register();
 		}
-
-		public void RemoveOneConfig(Type configType)
-		{
-			this.allConfig.Remove(configType, out _);
-		}
 		
 		public void Load()
 		{

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Share/Module/Console/ReloadConfigConsoleHandler.cs

@@ -23,7 +23,7 @@ namespace ET
                         Log.Console($"reload config but not find {category}");
                         return;
                     }
-                    ConfigComponent.Instance.RemoveOneConfig(type);
+                    ConfigComponent.Instance.Reload(type);
                     Log.Console($"reload config {configName} finish!");
                     break;
             }

+ 1 - 0
Unity/Assets/Scripts/Hotfix/Share/Module/Console/ReloadDllConsoleHandler.cs

@@ -6,6 +6,7 @@ namespace ET
         public async ETTask Run(Fiber fiber, ModeContex contex, string content)
         {
             await ETTask.CompletedTask;
+            CodeLoader.Instance.LoadHotfix();
         }
     }
 }