Explorar el Código

把EventSystem跟Type相关的抽出来放到CodeTypes里面

tanghai hace 2 años
padre
commit
deaf16cb0e
Se han modificado 24 ficheros con 116 adiciones y 87 borrados
  1. 6 9
      DotNet/Loader/CodeLoader.cs
  2. 1 1
      DotNet/Loader/ConfigLoader.cs
  3. 3 2
      Share/Tool/Init.cs
  4. 1 1
      Unity/Assets/Resources/GlobalConfig.asset
  5. 1 1
      Unity/Assets/Scripts/Core/Entity/EntitySystemSingleton.cs
  6. 2 2
      Unity/Assets/Scripts/Core/Network/OpcodeType.cs
  7. 1 1
      Unity/Assets/Scripts/Core/Serialize/MongoHelper.cs
  8. 2 2
      Unity/Assets/Scripts/Core/World/Module/Actor/ActorMessageDispatcherComponent.cs
  9. 8 0
      Unity/Assets/Scripts/Core/World/Module/Code.meta
  10. 54 0
      Unity/Assets/Scripts/Core/World/Module/Code/CodeTypes.cs
  11. 1 1
      Unity/Assets/Scripts/Core/World/Module/Code/CodeTypes.cs.meta
  12. 11 0
      Unity/Assets/Scripts/Core/World/Module/Config/ConfigLoader.cs.meta
  13. 8 49
      Unity/Assets/Scripts/Core/World/Module/EventSystem/EventSystem.cs
  14. 1 1
      Unity/Assets/Scripts/Hotfix/Share/Module/Console/ReloadConfigConsoleHandler.cs
  15. 6 8
      Unity/Assets/Scripts/Loader/CodeLoader.cs
  16. 1 1
      Unity/Assets/Scripts/Loader/ConfigLoader.cs
  17. 1 1
      Unity/Assets/Scripts/Model/Server/Module/Http/HttpDispatcher.cs
  18. 2 1
      Unity/Assets/Scripts/Model/Share/Entry.cs
  19. 1 1
      Unity/Assets/Scripts/Model/Share/LockStep/LSEntitySystemSingleton.cs
  20. 1 1
      Unity/Assets/Scripts/Model/Share/Module/AI/AIDispatcherComponent.cs
  21. 1 1
      Unity/Assets/Scripts/Model/Share/Module/Console/ConsoleDispatcher.cs
  22. 1 1
      Unity/Assets/Scripts/Model/Share/Module/Message/MessageDispatcherComponent.cs
  23. 1 1
      Unity/Assets/Scripts/Model/Share/Module/Numeric/NumericWatcherComponent.cs
  24. 1 1
      Unity/Assets/Scripts/ModelView/Client/Module/UI/UIEventComponent.cs

+ 6 - 9
DotNet/Loader/CodeLoader.cs

@@ -6,7 +6,6 @@ using System.Runtime.Loader;
 
 
 namespace ET
 namespace ET
 {
 {
-   
     public class CodeLoader: Singleton<CodeLoader>, ISingletonAwake
     public class CodeLoader: Singleton<CodeLoader>, ISingletonAwake
     {
     {
         private AssemblyLoadContext assemblyLoadContext;
         private AssemblyLoadContext assemblyLoadContext;
@@ -16,18 +15,17 @@ namespace ET
         public void Awake()
         public void Awake()
         {
         {
             Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
             Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
-            foreach (Assembly assembly in assemblies)
+            foreach (Assembly ass in assemblies)
             {
             {
-                if (assembly.GetName().Name == "Model")
+                if (ass.GetName().Name == "Model")
                 {
                 {
-                    this.assembly = assembly;
+                    this.assembly = ass;
                     break;
                     break;
                 }
                 }
             }
             }
             Assembly hotfixAssembly = this.LoadHotfix();
             Assembly hotfixAssembly = this.LoadHotfix();
-            
-            Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(typeof (World).Assembly, typeof(Init).Assembly, this.assembly, hotfixAssembly);
-            World.Instance.AddSingleton<EventSystem, Dictionary<string, Type>>(types);
+
+            World.Instance.AddSingleton<CodeTypes, Assembly[]>(new[] { typeof (World).Assembly, typeof(Init).Assembly, this.assembly, hotfixAssembly });
             
             
             IStaticMethod start = new StaticMethod(this.assembly, "ET.Entry", "Start");
             IStaticMethod start = new StaticMethod(this.assembly, "ET.Entry", "Start");
             start.Run();
             start.Run();
@@ -48,8 +46,7 @@ namespace ET
         {
         {
             Assembly hotfixAssembly = this.LoadHotfix();
             Assembly hotfixAssembly = this.LoadHotfix();
 			
 			
-            Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(typeof (World).Assembly, typeof(Init).Assembly, this.assembly, hotfixAssembly);
-            World.Instance.AddSingleton<EventSystem, Dictionary<string, Type>>(types, true);
+            World.Instance.AddSingleton<CodeTypes, Assembly[]>(new[] { typeof (World).Assembly, typeof(Init).Assembly, this.assembly, hotfixAssembly }, true);
 			
 			
             World.Instance.Load();
             World.Instance.Load();
 			
 			

+ 1 - 1
DotNet/Loader/ConfigLoader.cs

@@ -17,7 +17,7 @@ namespace ET
                 "StartSceneConfigCategory", 
                 "StartSceneConfigCategory", 
                 "StartZoneConfigCategory",
                 "StartZoneConfigCategory",
             };
             };
-            HashSet<Type> configTypes = EventSystem.Instance.GetTypes(typeof (ConfigAttribute));
+            HashSet<Type> configTypes = CodeTypes.Instance.GetTypes(typeof (ConfigAttribute));
             foreach (Type configType in configTypes)
             foreach (Type configType in configTypes)
             {
             {
                 string configFilePath;
                 string configFilePath;

+ 3 - 2
Share/Tool/Init.cs

@@ -1,5 +1,6 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Reflection;
 using System.Threading;
 using System.Threading;
 using CommandLine;
 using CommandLine;
 
 
@@ -30,8 +31,8 @@ namespace ET.Server
                 //process.AddSingleton<IdGenerater>();
                 //process.AddSingleton<IdGenerater>();
                 
                 
                 
                 
-                Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(typeof (Init).Assembly);
-                World.Instance.AddSingleton<EventSystem, Dictionary<string, Type>>(types);
+                World.Instance.AddSingleton<CodeTypes, Assembly[]>(new[] { typeof (Init).Assembly });
+                World.Instance.AddSingleton<EventSystem>();
                 
                 
                 MongoHelper.Register();
                 MongoHelper.Register();
                 
                 

+ 1 - 1
Unity/Assets/Resources/GlobalConfig.asset

@@ -12,6 +12,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 36527db572638af47b03c805671cba75, type: 3}
   m_Script: {fileID: 11500000, guid: 36527db572638af47b03c805671cba75, type: 3}
   m_Name: GlobalConfig
   m_Name: GlobalConfig
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
-  CodeMode: 3
+  CodeMode: 1
   BuildType: 1
   BuildType: 1
   AppType: 7
   AppType: 7

+ 1 - 1
Unity/Assets/Scripts/Core/Entity/EntitySystemSingleton.cs

@@ -11,7 +11,7 @@ namespace ET
         {
         {
             this.TypeSystems = new TypeSystems(InstanceQueueIndex.Max);
             this.TypeSystems = new TypeSystems(InstanceQueueIndex.Max);
 
 
-            foreach (Type type in EventSystem.Instance.GetTypes(typeof (EntitySystemAttribute)))
+            foreach (Type type in CodeTypes.Instance.GetTypes(typeof (EntitySystemAttribute)))
             {
             {
                 object obj = Activator.CreateInstance(type);
                 object obj = Activator.CreateInstance(type);
 
 

+ 2 - 2
Unity/Assets/Scripts/Core/Network/OpcodeType.cs

@@ -12,7 +12,7 @@ namespace ET
         
         
         public void Awake()
         public void Awake()
         {
         {
-            HashSet<Type> types = EventSystem.Instance.GetTypes(typeof (MessageAttribute));
+            HashSet<Type> types = CodeTypes.Instance.GetTypes(typeof (MessageAttribute));
             foreach (Type type in types)
             foreach (Type type in types)
             {
             {
                 object[] att = type.GetCustomAttributes(typeof (MessageAttribute), false);
                 object[] att = type.GetCustomAttributes(typeof (MessageAttribute), false);
@@ -50,7 +50,7 @@ namespace ET
                     }
                     }
 
 
                     ResponseTypeAttribute responseTypeAttribute = attrs[0] as ResponseTypeAttribute;
                     ResponseTypeAttribute responseTypeAttribute = attrs[0] as ResponseTypeAttribute;
-                    this.requestResponse.Add(type, EventSystem.Instance.GetType($"ET.{responseTypeAttribute.Type}"));
+                    this.requestResponse.Add(type, CodeTypes.Instance.GetType($"ET.{responseTypeAttribute.Type}"));
                 }
                 }
             }
             }
         }
         }

+ 1 - 1
Unity/Assets/Scripts/Core/Serialize/MongoHelper.cs

@@ -100,7 +100,7 @@ namespace ET
             RegisterStruct<TSVector4>();
             RegisterStruct<TSVector4>();
             RegisterStruct<TSQuaternion>();
             RegisterStruct<TSQuaternion>();
 
 
-            Dictionary<string, Type> types = EventSystem.Instance.GetTypes();
+            Dictionary<string, Type> types = CodeTypes.Instance.GetTypes();
             foreach (Type type in types.Values)
             foreach (Type type in types.Values)
             {
             {
                 if (!type.IsSubclassOf(typeof (Object)))
                 if (!type.IsSubclassOf(typeof (Object)))

+ 2 - 2
Unity/Assets/Scripts/Core/World/Module/Actor/ActorMessageDispatcherComponent.cs

@@ -25,14 +25,14 @@ namespace ET
 
 
         public void Awake()
         public void Awake()
         {
         {
-            HashSet<Type> types = EventSystem.Instance.GetTypes(typeof (ActorMessageHandlerAttribute));
+            HashSet<Type> types = CodeTypes.Instance.GetTypes(typeof (ActorMessageHandlerAttribute));
             
             
             foreach (Type type in types)
             foreach (Type type in types)
             {
             {
                 this.Register(type);
                 this.Register(type);
             }
             }
             
             
-            HashSet<Type> types2 = EventSystem.Instance.GetTypes(typeof (ActorMessageLocationHandlerAttribute));
+            HashSet<Type> types2 = CodeTypes.Instance.GetTypes(typeof (ActorMessageLocationHandlerAttribute));
             
             
             foreach (Type type in types2)
             foreach (Type type in types2)
             {
             {

+ 8 - 0
Unity/Assets/Scripts/Core/World/Module/Code.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c5e58c2ab3d7603459db136e7b34468f
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 54 - 0
Unity/Assets/Scripts/Core/World/Module/Code/CodeTypes.cs

@@ -0,0 +1,54 @@
+using System.Collections.Generic;
+using System.Reflection;
+using System;
+
+namespace ET
+{
+    public class CodeTypes: Singleton<CodeTypes>, ISingletonAwake<Assembly[]>
+    {
+        private readonly Dictionary<string, Type> allTypes = new();
+        private readonly UnOrderMultiMapSet<Type, Type> types = new();
+        
+        public void Awake(Assembly[] assemblies)
+        {
+            Dictionary<string, Type> addTypes = AssemblyHelper.GetAssemblyTypes(assemblies);
+            foreach ((string fullName, Type type) in addTypes)
+            {
+                this.allTypes[fullName] = type;
+                
+                if (type.IsAbstract)
+                {
+                    continue;
+                }
+                
+                // 记录所有的有BaseAttribute标记的的类型
+                object[] objects = type.GetCustomAttributes(typeof(BaseAttribute), true);
+
+                foreach (object o in objects)
+                {
+                    this.types.Add(o.GetType(), type);
+                }
+            }
+        }
+
+        public HashSet<Type> GetTypes(Type systemAttributeType)
+        {
+            if (!this.types.ContainsKey(systemAttributeType))
+            {
+                return new HashSet<Type>();
+            }
+
+            return this.types[systemAttributeType];
+        }
+
+        public Dictionary<string, Type> GetTypes()
+        {
+            return allTypes;
+        }
+
+        public Type GetType(string typeName)
+        {
+            return this.allTypes[typeName];
+        }
+    }
+}

+ 1 - 1
Unity/Assets/Scripts/Core/World/Module/Config/ConfigComponent.cs.meta → Unity/Assets/Scripts/Core/World/Module/Code/CodeTypes.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
 fileFormatVersion: 2
-guid: f3220f986cb182d4da3952ba65888ae4
+guid: d7ad14f4a26068a4986898db72c0fbf0
 MonoImporter:
 MonoImporter:
   externalObjects: {}
   externalObjects: {}
   serializedVersion: 2
   serializedVersion: 2

+ 11 - 0
Unity/Assets/Scripts/Core/World/Module/Config/ConfigLoader.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b7bde268b7610b44cb8f4ad4a436e2c8
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 49
Unity/Assets/Scripts/Core/World/Module/EventSystem/EventSystem.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 
 
 namespace ET
 namespace ET
 {
 {
-    public class EventSystem: Singleton<EventSystem>, ISingletonAwake<Dictionary<string, Type>>
+    public class EventSystem: Singleton<EventSystem>, ISingletonAwake, ISingletonLoad
     {
     {
         private class EventInfo
         private class EventInfo
         {
         {
@@ -18,39 +18,14 @@ namespace ET
             }
             }
         }
         }
         
         
-        private readonly Dictionary<string, Type> allTypes = new();
-
-        private readonly UnOrderMultiMapSet<Type, Type> types = new();
-
         private readonly Dictionary<Type, List<EventInfo>> allEvents = new();
         private readonly Dictionary<Type, List<EventInfo>> allEvents = new();
         
         
         private Dictionary<Type, Dictionary<long, object>> allInvokes = new(); 
         private Dictionary<Type, Dictionary<long, object>> allInvokes = new(); 
         
         
-        public void Awake(Dictionary<string, Type> addTypes)
+        public void Awake()
         {
         {
-            this.allTypes.Clear();
-            this.types.Clear();
-            
-            foreach ((string fullName, Type type) in addTypes)
-            {
-                this.allTypes[fullName] = type;
-                
-                if (type.IsAbstract)
-                {
-                    continue;
-                }
-                
-                // 记录所有的有BaseAttribute标记的的类型
-                object[] objects = type.GetCustomAttributes(typeof(BaseAttribute), true);
-
-                foreach (object o in objects)
-                {
-                    this.types.Add(o.GetType(), type);
-                }
-            }
-
-            this.allEvents.Clear();
-            foreach (Type type in types[typeof (EventAttribute)])
+            CodeTypes codeTypes = CodeTypes.Instance;
+            foreach (Type type in codeTypes.GetTypes(typeof (EventAttribute)))
             {
             {
                 IEvent obj = Activator.CreateInstance(type) as IEvent;
                 IEvent obj = Activator.CreateInstance(type) as IEvent;
                 if (obj == null)
                 if (obj == null)
@@ -75,8 +50,7 @@ namespace ET
                 }
                 }
             }
             }
 
 
-            this.allInvokes = new Dictionary<Type, Dictionary<long, object>>();
-            foreach (Type type in types[typeof (InvokeAttribute)])
+            foreach (Type type in codeTypes.GetTypes(typeof (InvokeAttribute)))
             {
             {
                 object obj = Activator.CreateInstance(type);
                 object obj = Activator.CreateInstance(type);
                 IInvoke iInvoke = obj as IInvoke;
                 IInvoke iInvoke = obj as IInvoke;
@@ -107,25 +81,10 @@ namespace ET
                 }
                 }
             }
             }
         }
         }
-
-        public HashSet<Type> GetTypes(Type systemAttributeType)
-        {
-            if (!this.types.ContainsKey(systemAttributeType))
-            {
-                return new HashSet<Type>();
-            }
-
-            return this.types[systemAttributeType];
-        }
-
-        public Dictionary<string, Type> GetTypes()
-        {
-            return allTypes;
-        }
-
-        public Type GetType(string typeName)
+        
+        public void Load()
         {
         {
-            return this.allTypes[typeName];
+            World.Instance.AddSingleton<EventSystem>(true);
         }
         }
 
 
         public async ETTask PublishAsync<S, T>(S scene, T a) where S: class, IScene where T : struct
         public async ETTask PublishAsync<S, T>(S scene, T a) where S: class, IScene where T : struct

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

@@ -17,7 +17,7 @@ namespace ET
                     string[] ss = content.Split(" ");
                     string[] ss = content.Split(" ");
                     string configName = ss[1];
                     string configName = ss[1];
                     string category = $"{configName}Category";
                     string category = $"{configName}Category";
-                    Type type = EventSystem.Instance.GetType($"ET.{category}");
+                    Type type = CodeTypes.Instance.GetType($"ET.{category}");
                     if (type == null)
                     if (type == null)
                     {
                     {
                         Log.Console($"reload config but not find {category}");
                         Log.Console($"reload config but not find {category}");

+ 6 - 8
Unity/Assets/Scripts/Loader/CodeLoader.cs

@@ -26,8 +26,9 @@ namespace ET
 				}
 				}
 				
 				
 				Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
 				Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
-				Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(assemblies);
-				World.Instance.AddSingleton<EventSystem, Dictionary<string, Type>>(types);
+				
+				World.Instance.AddSingleton<CodeTypes, Assembly[]>(assemblies);
+				
 				foreach (Assembly ass in assemblies)
 				foreach (Assembly ass in assemblies)
 				{
 				{
 					string name = ass.GetName().Name;
 					string name = ass.GetName().Name;
@@ -68,9 +69,7 @@ namespace ET
 			{
 			{
 				Assembly hotfixAssembly = this.LoadHotfix();
 				Assembly hotfixAssembly = this.LoadHotfix();
 
 
-				Dictionary<string, Type> types =
-						AssemblyHelper.GetAssemblyTypes(typeof (World).Assembly, typeof (Init).Assembly, this.assembly, hotfixAssembly);
-				World.Instance.AddSingleton<EventSystem, Dictionary<string, Type>>(types);
+				World.Instance.AddSingleton<CodeTypes, Assembly[]>(new []{typeof (World).Assembly, typeof(Init).Assembly, this.assembly, hotfixAssembly});
 
 
 				IStaticMethod start = new StaticMethod(this.assembly, "ET.Entry", "Start");
 				IStaticMethod start = new StaticMethod(this.assembly, "ET.Entry", "Start");
 				start.Run();
 				start.Run();
@@ -105,9 +104,8 @@ namespace ET
 		public void Reload()
 		public void Reload()
 		{
 		{
 			Assembly hotfixAssembly = this.LoadHotfix();
 			Assembly hotfixAssembly = this.LoadHotfix();
-			
-			Dictionary<string, Type> types = AssemblyHelper.GetAssemblyTypes(typeof (World).Assembly, typeof(Init).Assembly, this.assembly, hotfixAssembly);
-			World.Instance.AddSingleton<EventSystem, Dictionary<string, Type>>(types, true);
+
+			World.Instance.AddSingleton<CodeTypes, Assembly[]>(new []{typeof (World).Assembly, typeof(Init).Assembly, this.assembly, hotfixAssembly}, true);
 			
 			
 			World.Instance.Load();
 			World.Instance.Load();
 			
 			

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

@@ -11,7 +11,7 @@ namespace ET
         public override Dictionary<Type, byte[]> Handle(ConfigLoader.GetAllConfigBytes args)
         public override Dictionary<Type, byte[]> Handle(ConfigLoader.GetAllConfigBytes args)
         {
         {
             Dictionary<Type, byte[]> output = new Dictionary<Type, byte[]>();
             Dictionary<Type, byte[]> output = new Dictionary<Type, byte[]>();
-            HashSet<Type> configTypes = EventSystem.Instance.GetTypes(typeof (ConfigAttribute));
+            HashSet<Type> configTypes = CodeTypes.Instance.GetTypes(typeof (ConfigAttribute));
             
             
             if (Define.IsEditor)
             if (Define.IsEditor)
             {
             {

+ 1 - 1
Unity/Assets/Scripts/Model/Server/Module/Http/HttpDispatcher.cs

@@ -14,7 +14,7 @@ namespace ET.Server
 
 
         public void Awake()
         public void Awake()
         {
         {
-            HashSet<Type> types = EventSystem.Instance.GetTypes(typeof (HttpHandlerAttribute));
+            HashSet<Type> types = CodeTypes.Instance.GetTypes(typeof (HttpHandlerAttribute));
 
 
             foreach (Type type in types)
             foreach (Type type in types)
             {
             {

+ 2 - 1
Unity/Assets/Scripts/Model/Share/Entry.cs

@@ -36,7 +36,8 @@ namespace ET
             
             
             MongoHelper.RegisterStruct<LSInput>();
             MongoHelper.RegisterStruct<LSInput>();
             MongoHelper.Register();
             MongoHelper.Register();
-            
+
+            World.Instance.AddSingleton<EventSystem>();
             World.Instance.AddSingleton<OpcodeType>();
             World.Instance.AddSingleton<OpcodeType>();
             World.Instance.AddSingleton<IdValueGenerater>();
             World.Instance.AddSingleton<IdValueGenerater>();
             World.Instance.AddSingleton<ObjectPool>();
             World.Instance.AddSingleton<ObjectPool>();

+ 1 - 1
Unity/Assets/Scripts/Model/Share/LockStep/LSEntitySystemSingleton.cs

@@ -18,7 +18,7 @@ namespace ET
         public void Awake()
         public void Awake()
         {
         {
             this.TypeSystems = new(LSQueneUpdateIndex.Max);
             this.TypeSystems = new(LSQueneUpdateIndex.Max);
-            foreach (Type type in EventSystem.Instance.GetTypes(typeof (LSEntitySystemAttribute)))
+            foreach (Type type in CodeTypes.Instance.GetTypes(typeof (LSEntitySystemAttribute)))
             {
             {
                 object obj = Activator.CreateInstance(type);
                 object obj = Activator.CreateInstance(type);
 
 

+ 1 - 1
Unity/Assets/Scripts/Model/Share/Module/AI/AIDispatcherComponent.cs

@@ -9,7 +9,7 @@ namespace ET
         
         
         public void Awake()
         public void Awake()
         {
         {
-            var types = EventSystem.Instance.GetTypes(typeof (AIHandlerAttribute));
+            var types = CodeTypes.Instance.GetTypes(typeof (AIHandlerAttribute));
             foreach (Type type in types)
             foreach (Type type in types)
             {
             {
                 AAIHandler aaiHandler = Activator.CreateInstance(type) as AAIHandler;
                 AAIHandler aaiHandler = Activator.CreateInstance(type) as AAIHandler;

+ 1 - 1
Unity/Assets/Scripts/Model/Share/Module/Console/ConsoleDispatcher.cs

@@ -14,7 +14,7 @@ namespace ET
 
 
         public void Awake()
         public void Awake()
         {
         {
-            HashSet<Type> types = EventSystem.Instance.GetTypes(typeof (ConsoleHandlerAttribute));
+            HashSet<Type> types = CodeTypes.Instance.GetTypes(typeof (ConsoleHandlerAttribute));
 
 
             foreach (Type type in types)
             foreach (Type type in types)
             {
             {

+ 1 - 1
Unity/Assets/Scripts/Model/Share/Module/Message/MessageDispatcherComponent.cs

@@ -21,7 +21,7 @@ namespace ET
         
         
         public void Awake()
         public void Awake()
         {
         {
-            HashSet<Type> types = EventSystem.Instance.GetTypes(typeof (MessageHandlerAttribute));
+            HashSet<Type> types = CodeTypes.Instance.GetTypes(typeof (MessageHandlerAttribute));
 
 
             foreach (Type type in types)
             foreach (Type type in types)
             {
             {

+ 1 - 1
Unity/Assets/Scripts/Model/Share/Module/Numeric/NumericWatcherComponent.cs

@@ -24,7 +24,7 @@ namespace ET
         
         
         public void Awake()
         public void Awake()
         {
         {
-            HashSet<Type> types = EventSystem.Instance.GetTypes(typeof(NumericWatcherAttribute));
+            HashSet<Type> types = CodeTypes.Instance.GetTypes(typeof(NumericWatcherAttribute));
             foreach (Type type in types)
             foreach (Type type in types)
             {
             {
                 object[] attrs = type.GetCustomAttributes(typeof(NumericWatcherAttribute), false);
                 object[] attrs = type.GetCustomAttributes(typeof(NumericWatcherAttribute), false);

+ 1 - 1
Unity/Assets/Scripts/ModelView/Client/Module/UI/UIEventComponent.cs

@@ -12,7 +12,7 @@ namespace ET.Client
 		
 		
         public void Awake()
         public void Awake()
         {
         {
-            var uiEvents = EventSystem.Instance.GetTypes(typeof (UIEventAttribute));
+            var uiEvents = CodeTypes.Instance.GetTypes(typeof (UIEventAttribute));
             foreach (Type type in uiEvents)
             foreach (Type type in uiEvents)
             {
             {
                 object[] attrs = type.GetCustomAttributes(typeof (UIEventAttribute), false);
                 object[] attrs = type.GetCustomAttributes(typeof (UIEventAttribute), false);