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

ConfigComponent改成ConfigLoader,跟CodeLoader对应

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

+ 4 - 4
DotNet/Loader/ConfigLoader.cs

@@ -5,9 +5,9 @@ using System.IO;
 namespace ET
 {
     [Invoke]
-    public class GetAllConfigBytes: AInvokeHandler<ConfigComponent.GetAllConfigBytes, Dictionary<Type, byte[]>>
+    public class GetAllConfigBytes: AInvokeHandler<ConfigLoader.GetAllConfigBytes, Dictionary<Type, byte[]>>
     {
-        public override Dictionary<Type, byte[]> Handle(ConfigComponent.GetAllConfigBytes args)
+        public override Dictionary<Type, byte[]> Handle(ConfigLoader.GetAllConfigBytes args)
         {
             Dictionary<Type, byte[]> output = new Dictionary<Type, byte[]>();
             List<string> startConfigs = new List<string>()
@@ -37,9 +37,9 @@ namespace ET
     }
     
     [Invoke]
-    public class GetOneConfigBytes: AInvokeHandler<ConfigComponent.GetOneConfigBytes, byte[]>
+    public class GetOneConfigBytes: AInvokeHandler<ConfigLoader.GetOneConfigBytes, byte[]>
     {
-        public override byte[] Handle(ConfigComponent.GetOneConfigBytes args)
+        public override byte[] Handle(ConfigLoader.GetOneConfigBytes args)
         {
             byte[] configBytes = File.ReadAllBytes($"../Config/Excel/s/{args.ConfigName}.bytes");
             return configBytes;

+ 2 - 2
Unity/Assets/Scripts/Core/World/Module/Config/ConfigComponent.cs → Unity/Assets/Scripts/Core/World/Module/Config/ConfigLoader.cs

@@ -6,9 +6,9 @@ using System.Threading.Tasks;
 namespace ET
 {
 	/// <summary>
-    /// Config组件会扫描所有的有ConfigAttribute标签的配置,加载进来
+    /// ConfigLoader会扫描所有的有ConfigAttribute标签的配置,加载进来
     /// </summary>
-    public class ConfigComponent: Singleton<ConfigComponent>, ISingletonAwake
+    public class ConfigLoader: Singleton<ConfigLoader>, ISingletonAwake
     {
         public struct GetAllConfigBytes
         {

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Share/Demo/EntryEvent1_InitShare.cs

@@ -5,7 +5,7 @@ namespace ET
     {
         protected override async ETTask Run(Scene root, EventType.EntryEvent1 args)
         {
-            await World.Instance.AddSingleton<ConfigComponent>().LoadAsync();
+            await World.Instance.AddSingleton<ConfigLoader>().LoadAsync();
             
             root.AddComponent<ObjectWait>();
             root.AddComponent<MailBoxComponent, MailBoxType>(MailBoxType.UnOrderedMessage);

+ 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.Reload(type);
+                    ConfigLoader.Instance.Reload(type);
                     Log.Console($"reload config {configName} finish!");
                     break;
             }

+ 4 - 4
Unity/Assets/Scripts/Loader/ConfigLoader.cs

@@ -6,9 +6,9 @@ using UnityEngine;
 namespace ET
 {
     [Invoke]
-    public class GetAllConfigBytes: AInvokeHandler<ConfigComponent.GetAllConfigBytes, Dictionary<Type, byte[]>>
+    public class GetAllConfigBytes: AInvokeHandler<ConfigLoader.GetAllConfigBytes, Dictionary<Type, byte[]>>
     {
-        public override Dictionary<Type, byte[]> Handle(ConfigComponent.GetAllConfigBytes args)
+        public override Dictionary<Type, byte[]> Handle(ConfigLoader.GetAllConfigBytes args)
         {
             Dictionary<Type, byte[]> output = new Dictionary<Type, byte[]>();
             HashSet<Type> configTypes = EventSystem.Instance.GetTypes(typeof (ConfigAttribute));
@@ -68,9 +68,9 @@ namespace ET
     }
     
     [Invoke]
-    public class GetOneConfigBytes: AInvokeHandler<ConfigComponent.GetOneConfigBytes, byte[]>
+    public class GetOneConfigBytes: AInvokeHandler<ConfigLoader.GetOneConfigBytes, byte[]>
     {
-        public override byte[] Handle(ConfigComponent.GetOneConfigBytes args)
+        public override byte[] Handle(ConfigLoader.GetOneConfigBytes args)
         {
             string ct = "cs";
             GlobalConfig globalConfig = Resources.Load<GlobalConfig>("GlobalConfig");