Răsfoiți Sursa

优化获取程序集Type集合

tanghai 7 ani în urmă
părinte
comite
c7500f183a
31 a modificat fișierele cu 344 adăugiri și 116 ștergeri
  1. 2 1
      Server/Hotfix/Module/Actor/ActorMessageDispatherComponentSystem.cs
  2. 1 1
      Server/Hotfix/Module/Message/MessageDispatherComponentSystem.cs
  3. 7 25
      Server/Hotfix/Module/Message/NetOuterComponentSystem.cs
  4. 0 10
      Server/Model/Base/Helper/DllHelper.cs
  5. 1 1
      Server/Model/Module/Http/HttpComponent.cs
  6. 1 1
      Unity/Assets/Editor/BehaviorTreeEditor/NodeMetaHelper.cs
  7. 9 4
      Unity/Assets/Scripts/Base/Object/EventSystem.cs
  8. 5 4
      Unity/Assets/Scripts/Entity/Hotfix.cs
  9. 0 33
      Unity/Assets/Scripts/Helper/DllHelper.cs
  10. 1 1
      Unity/Assets/Scripts/Module/BehaviorTree/BehaviorTreeComponent.cs
  11. 1 1
      Unity/Assets/Scripts/Module/Config/ConfigComponent.cs
  12. 1 1
      Unity/Assets/Scripts/Module/Message/MessageDispatherComponent.cs
  13. 1 2
      Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs
  14. 2 1
      Unity/Assets/Scripts/Module/Message/OpcodeTypeComponent.cs
  15. 1 1
      Unity/Assets/Scripts/Module/Numeric/NumericWatcherComponent.cs
  16. 1 1
      Unity/Assets/Scripts/Module/UI/UIComponent.cs
  17. 3 1
      Unity/Assets/ThirdParty/ILRuntime/Generated/CLRBindings.cs
  18. 5 0
      Unity/Assets/ThirdParty/ILRuntime/Generated/ETModel_Hotfix_Binding.cs
  19. 22 2
      Unity/Assets/ThirdParty/ILRuntime/Generated/ETModel_Packet_Binding.cs
  20. 42 6
      Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_Dictionary_2_Int32_Action_1_ILTypeI_t.cs
  21. 50 0
      Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_List_1_Type_Binding.cs
  22. 4 3
      Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_List_1_Type_Binding.cs.meta
  23. 126 0
      Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_List_1_Type_Binding_Enumerator_Bind_t.cs
  24. 13 0
      Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_List_1_Type_Binding_Enumerator_Bind_t.cs.meta
  25. 33 3
      Unity/Assets/ThirdParty/ILRuntime/Generated/System_Linq_Enumerable_Binding.cs
  26. 1 1
      Unity/Hotfix/Base/Object/EventSystem.cs
  27. 1 1
      Unity/Hotfix/Module/Config/ConfigComponent.cs
  28. 1 1
      Unity/Hotfix/Module/Message/MessageDispatherComponent.cs
  29. 2 1
      Unity/Hotfix/Module/Message/OpcodeTypeComponent.cs
  30. 1 1
      Unity/Hotfix/Module/UI/UIComponent.cs
  31. 6 8
      Unity/Unity.csproj

+ 2 - 1
Server/Hotfix/Module/Actor/ActorMessageDispatherComponentSystem.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Threading.Tasks;
 using ETModel;
 
@@ -39,7 +40,7 @@ namespace ETHotfix
 			self.ActorMessageHandlers.Clear();
 			self.ActorTypeHandlers.Clear();
 
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 
 			foreach (Type type in types)
 			{

+ 1 - 1
Server/Hotfix/Module/Message/MessageDispatherComponentSystem.cs

@@ -33,7 +33,7 @@ namespace ETHotfix
 
 			AppType appType = Game.Scene.GetComponent<StartConfigComponent>().StartConfig.AppType;
 
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 
 			foreach (Type type in types)
 			{

+ 7 - 25
Server/Hotfix/Module/Message/NetOuterComponentSystem.cs

@@ -8,16 +8,20 @@ namespace ETHotfix
 	{
 		public override void Awake(NetOuterComponent self)
 		{
-			self.Awake();
+			self.Awake(NetworkProtocol.KCP);
+			self.MessagePacker = new ProtobufPacker();
+			self.MessageDispatcher = new OuterMessageDispatcher();
 		}
 	}
 
 	[ObjectSystem]
 	public class NetOuterComponentAwake1System : AwakeSystem<NetOuterComponent, IPEndPoint>
 	{
-		public override void Awake(NetOuterComponent self, IPEndPoint a)
+		public override void Awake(NetOuterComponent self, IPEndPoint ipEndPoint)
 		{
-			self.Awake(a);
+			self.Awake(NetworkProtocol.KCP, ipEndPoint);
+			self.MessagePacker = new ProtobufPacker();
+			self.MessageDispatcher = new OuterMessageDispatcher();
 		}
 	}
 
@@ -29,26 +33,4 @@ namespace ETHotfix
 			self.Update();
 		}
 	}
-
-	public static class NetOuterComponentEx
-	{
-		public static void Awake(this NetOuterComponent self)
-		{
-			self.Awake(NetworkProtocol.KCP);
-			self.MessagePacker = new ProtobufPacker();
-			self.MessageDispatcher = new OuterMessageDispatcher();
-		}
-
-		public static void Awake(this NetOuterComponent self, IPEndPoint ipEndPoint)
-		{
-			self.Awake(NetworkProtocol.KCP, ipEndPoint);
-			self.MessagePacker = new ProtobufPacker();
-			self.MessageDispatcher = new OuterMessageDispatcher();
-		}
-
-		public static void Update(this NetOuterComponent self)
-		{
-			self.Update();
-		}
-	}
 }

+ 0 - 10
Server/Model/Base/Helper/DllHelper.cs

@@ -18,15 +18,5 @@ namespace ETModel
 			Assembly assembly = Assembly.Load(dllBytes, pdbBytes);
 			return assembly;
 		}
-
-		public static Type[] GetMonoTypes()
-		{
-			List<Type> types = new List<Type>();
-			foreach (Assembly assembly in Game.EventSystem.GetAll())
-			{
-				types.AddRange(assembly.GetTypes());
-			}
-			return types.ToArray();
-		}
 	}
 }

+ 1 - 1
Server/Model/Module/Http/HttpComponent.cs

@@ -67,7 +67,7 @@ namespace ETModel
 			this.getHandlers = new Dictionary<string, MethodInfo>();
 			this.postHandlers = new Dictionary<string, MethodInfo>();
 
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 
 			foreach (Type type in types)
 			{

+ 1 - 1
Unity/Assets/Editor/BehaviorTreeEditor/NodeMetaHelper.cs

@@ -29,7 +29,7 @@ namespace ETEditor
 		public static Dictionary<string, NodeMeta> ExportToDict()
 		{
 			Dictionary<string, NodeMeta> name2NodeProtoDict = new Dictionary<string, NodeMeta>();
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 			foreach (Type type in types)
 			{
 				NodeMeta proto = GetNodeTypeProtoFromType(type);

+ 9 - 4
Unity/Assets/Scripts/Base/Object/EventSystem.cs

@@ -17,6 +17,7 @@ namespace ETModel
 		private readonly Dictionary<long, Component> allComponents = new Dictionary<long, Component>();
 
 		private readonly Dictionary<DLLType, Assembly> assemblies = new Dictionary<DLLType, Assembly>();
+		private readonly List<Type> types = new List<Type>();
 
 		private readonly Dictionary<string, List<IEvent>> allEvents = new Dictionary<string, List<IEvent>>();
 
@@ -48,6 +49,11 @@ namespace ETModel
 		public void Add(DLLType dllType, Assembly assembly)
 		{
 			this.assemblies[dllType] = assembly;
+			this.types.Clear();
+			foreach (Assembly value in this.assemblies.Values)
+			{
+				this.types.AddRange(value.GetTypes());
+			}
 
 			this.awakeSystems.Clear();
 			this.lateUpdateSystems.Clear();
@@ -56,7 +62,6 @@ namespace ETModel
 			this.loadSystems.Clear();
 			this.changeSystems.Clear();
 
-			Type[] types = DllHelper.GetMonoTypes();
 			foreach (Type type in types)
 			{
 				object[] attrs = type.GetCustomAttributes(typeof(ObjectSystemAttribute), false);
@@ -145,10 +150,10 @@ namespace ETModel
 		{
 			return this.assemblies[dllType];
 		}
-
-		public Assembly[] GetAll()
+		
+		public List<Type> GetTypes()
 		{
-			return this.assemblies.Values.ToArray();
+			return this.types;
 		}
 
 		public void Add(Component component)

+ 5 - 4
Unity/Assets/Scripts/Entity/Hotfix.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Reflection;
@@ -33,7 +34,7 @@ namespace ETModel
 			this.start.Run();
 		}
 
-		public Type[] GetHotfixTypes()
+		public List<Type> GetHotfixTypes()
 		{
 #if ILRuntime
 			if (this.appDomain == null)
@@ -41,13 +42,13 @@ namespace ETModel
 				return new Type[0];
 			}
 
-			return this.appDomain.LoadedTypes.Values.Select(x => x.ReflectionType).ToArray();
+			return this.appDomain.LoadedTypes.Values.Select(x => x.ReflectionType);
 #else
 			if (this.assembly == null)
 			{
-				return new Type[0];
+				return new List<Type>();
 			}
-			return this.assembly.GetTypes();
+			return this.assembly.GetTypes().ToList();
 #endif
 		}
 

+ 0 - 33
Unity/Assets/Scripts/Helper/DllHelper.cs

@@ -1,33 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-
-namespace ETModel
-{
-	public static class DllHelper
-	{
-		public static Type[] GetMonoTypes()
-		{
-			List<Type> types = new List<Type>();
-			foreach (Assembly assembly in Game.EventSystem.GetAll())
-			{
-				types.AddRange(assembly.GetTypes());
-			}
-			
-			return types.ToArray();
-		}
-
-		public static Type[] GetAllTypes()
-		{
-			List<Type> types = new List<Type>();
-			foreach (Assembly assembly in Game.EventSystem.GetAll())
-			{
-				types.AddRange(assembly.GetTypes());
-			}
-
-			types.AddRange(Game.Hotfix.GetHotfixTypes());
-			return types.ToArray();
-		}
-	}
-}

+ 1 - 1
Unity/Assets/Scripts/Module/BehaviorTree/BehaviorTreeComponent.cs

@@ -42,7 +42,7 @@ namespace ETModel
 			this.treeCache = new Dictionary<GameObject, BehaviorTree>();
 
 		
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 			foreach (Type type in types)
 			{
 				object[] attrs = type.GetCustomAttributes(typeof(NodeAttribute), false);

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

@@ -36,7 +36,7 @@ namespace ETModel
 		public void Load()
 		{
 			this.allConfig.Clear();
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 
 			foreach (Type type in types)
 			{

+ 1 - 1
Unity/Assets/Scripts/Module/Message/MessageDispatherComponent.cs

@@ -37,7 +37,7 @@ namespace ETModel
 		{
 			this.handlers.Clear();
 
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 
 			foreach (Type type in types)
 			{

+ 1 - 2
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs

@@ -161,8 +161,7 @@ namespace ETModel
 			e.RemoteEndPoint = null;
 			this.isConnected = true;
 			
-			this.StartRecv();
-			this.StartSend();
+			this.Start();
 		}
 
 		private void OnDisconnectComplete(object o)

+ 2 - 1
Unity/Assets/Scripts/Module/Message/OpcodeTypeComponent.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 
 namespace ETModel
 {
@@ -17,7 +18,7 @@ namespace ETModel
 
 		public void Awake()
 		{
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 			foreach (Type type in types)
 			{
 				object[] attrs = type.GetCustomAttributes(typeof(MessageAttribute), false);

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

@@ -37,7 +37,7 @@ namespace ETModel
 		{
 			this.allWatchers = new Dictionary<NumericType, List<INumericWatcher>>();
 
-			Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 			foreach (Type type in types)
 			{
 				object[] attrs = type.GetCustomAttributes(typeof(NumericWatcherAttribute), false);

+ 1 - 1
Unity/Assets/Scripts/Module/UI/UIComponent.cs

@@ -66,7 +66,7 @@ namespace ETModel
 		{
 			this.UiTypes.Clear();
             
-            Type[] types = DllHelper.GetMonoTypes();
+			List<Type> types = Game.EventSystem.GetTypes();
 
 			foreach (Type type in types)
 			{

+ 3 - 1
Unity/Assets/ThirdParty/ILRuntime/Generated/CLRBindings.cs

@@ -51,6 +51,8 @@ namespace ILRuntime.Runtime.Generated
             ETModel_MoveComponent_Binding.Register(app);
             System_Collections_Generic_Dictionary_2_Type_ILTypeInstance_Binding.Register(app);
             ETModel_Hotfix_Binding.Register(app);
+            System_Collections_Generic_List_1_Type_Binding.Register(app);
+            System_Collections_Generic_List_1_Type_Binding_Enumerator_Binding.Register(app);
             System_Type_Binding.Register(app);
             System_Reflection_MemberInfo_Binding.Register(app);
             System_Activator_Binding.Register(app);
@@ -74,10 +76,10 @@ namespace ILRuntime.Runtime.Generated
             System_Collections_Generic_Dictionary_2_Type_Queue_1_ILTypeInstance_Binding.Register(app);
             System_Collections_Generic_Queue_1_ILTypeInstance_Binding.Register(app);
             ETModel_SessionCallbackComponent_Binding.Register(app);
+            System_Collections_Generic_Dictionary_2_Int32_Action_1_ILTypeInstance_Binding.Register(app);
             ETModel_Component_Binding.Register(app);
             ETModel_Packet_Binding.Register(app);
             ETModel_ProtobufHelper_Binding.Register(app);
-            System_Collections_Generic_Dictionary_2_Int32_Action_1_ILTypeInstance_Binding.Register(app);
             ETModel_MessageInfo_Binding.Register(app);
             System_Threading_Tasks_TaskCompletionSource_1_ILTypeInstance_Binding.Register(app);
             System_Threading_CancellationToken_Binding.Register(app);

+ 5 - 0
Unity/Assets/ThirdParty/ILRuntime/Generated/ETModel_Hotfix_Binding.cs

@@ -52,6 +52,11 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetHotfixTypes();
 
+            object obj_result_of_this_method = result_of_this_method;
+            if(obj_result_of_this_method is CrossBindingAdaptorType)
+            {    
+                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
+            }
             return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
         }
 

+ 22 - 2
Unity/Assets/ThirdParty/ILRuntime/Generated/ETModel_Packet_Binding.cs

@@ -31,8 +31,11 @@ namespace ILRuntime.Runtime.Generated
             method = type.GetMethod("get_Bytes", flag, null, args, null);
             app.RegisterCLRMethodRedirection(method, get_Bytes_2);
             args = new Type[]{};
+            method = type.GetMethod("get_Offset", flag, null, args, null);
+            app.RegisterCLRMethodRedirection(method, get_Offset_3);
+            args = new Type[]{};
             method = type.GetMethod("get_Length", flag, null, args, null);
-            app.RegisterCLRMethodRedirection(method, get_Length_3);
+            app.RegisterCLRMethodRedirection(method, get_Length_4);
 
 
         }
@@ -87,7 +90,24 @@ namespace ILRuntime.Runtime.Generated
             return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
         }
 
-        static StackObject* get_Length_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        static StackObject* get_Offset_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        {
+            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
+            StackObject* ptr_of_this_method;
+            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
+
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
+            ETModel.Packet instance_of_this_method = (ETModel.Packet)typeof(ETModel.Packet).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
+            __intp.Free(ptr_of_this_method);
+
+            var result_of_this_method = instance_of_this_method.Offset;
+
+            __ret->ObjectType = ObjectTypes.Integer;
+            __ret->Value = result_of_this_method;
+            return __ret + 1;
+        }
+
+        static StackObject* get_Length_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
         {
             ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
             StackObject* ptr_of_this_method;

+ 42 - 6
Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_Dictionary_2_Int32_Action_1_ILTypeI_t.cs

@@ -21,15 +21,21 @@ namespace ILRuntime.Runtime.Generated
             MethodBase method;
             Type[] args;
             Type type = typeof(System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>);
+            args = new Type[]{};
+            method = type.GetMethod("get_Values", flag, null, args, null);
+            app.RegisterCLRMethodRedirection(method, get_Values_0);
+            args = new Type[]{};
+            method = type.GetMethod("Clear", flag, null, args, null);
+            app.RegisterCLRMethodRedirection(method, Clear_1);
             args = new Type[]{typeof(System.Int32), typeof(System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>).MakeByRefType()};
             method = type.GetMethod("TryGetValue", flag, null, args, null);
-            app.RegisterCLRMethodRedirection(method, TryGetValue_0);
+            app.RegisterCLRMethodRedirection(method, TryGetValue_2);
             args = new Type[]{typeof(System.Int32)};
             method = type.GetMethod("Remove", flag, null, args, null);
-            app.RegisterCLRMethodRedirection(method, Remove_1);
+            app.RegisterCLRMethodRedirection(method, Remove_3);
             args = new Type[]{typeof(System.Int32), typeof(System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>)};
             method = type.GetMethod("set_Item", flag, null, args, null);
-            app.RegisterCLRMethodRedirection(method, set_Item_2);
+            app.RegisterCLRMethodRedirection(method, set_Item_4);
 
             args = new Type[]{};
             method = type.GetConstructor(flag, null, args, null);
@@ -38,7 +44,37 @@ namespace ILRuntime.Runtime.Generated
         }
 
 
-        static StackObject* TryGetValue_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        static StackObject* get_Values_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        {
+            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
+            StackObject* ptr_of_this_method;
+            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
+
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
+            System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>> instance_of_this_method = (System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>)typeof(System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
+            __intp.Free(ptr_of_this_method);
+
+            var result_of_this_method = instance_of_this_method.Values;
+
+            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
+        }
+
+        static StackObject* Clear_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        {
+            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
+            StackObject* ptr_of_this_method;
+            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
+
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
+            System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>> instance_of_this_method = (System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>)typeof(System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
+            __intp.Free(ptr_of_this_method);
+
+            instance_of_this_method.Clear();
+
+            return __ret;
+        }
+
+        static StackObject* TryGetValue_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
         {
             ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
             StackObject* ptr_of_this_method;
@@ -116,7 +152,7 @@ namespace ILRuntime.Runtime.Generated
             return __ret + 1;
         }
 
-        static StackObject* Remove_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        static StackObject* Remove_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
         {
             ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
             StackObject* ptr_of_this_method;
@@ -136,7 +172,7 @@ namespace ILRuntime.Runtime.Generated
             return __ret + 1;
         }
 
-        static StackObject* set_Item_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        static StackObject* set_Item_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
         {
             ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
             StackObject* ptr_of_this_method;

+ 50 - 0
Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_List_1_Type_Binding.cs

@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+using ILRuntime.CLR.TypeSystem;
+using ILRuntime.CLR.Method;
+using ILRuntime.Runtime.Enviorment;
+using ILRuntime.Runtime.Intepreter;
+using ILRuntime.Runtime.Stack;
+using ILRuntime.Reflection;
+using ILRuntime.CLR.Utils;
+
+namespace ILRuntime.Runtime.Generated
+{
+    unsafe class System_Collections_Generic_List_1_Type_Binding
+    {
+        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
+        {
+            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
+            MethodBase method;
+            Type[] args;
+            Type type = typeof(System.Collections.Generic.List<System.Type>);
+            args = new Type[]{};
+            method = type.GetMethod("GetEnumerator", flag, null, args, null);
+            app.RegisterCLRMethodRedirection(method, GetEnumerator_0);
+
+
+        }
+
+
+        static StackObject* GetEnumerator_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        {
+            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
+            StackObject* ptr_of_this_method;
+            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
+
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
+            System.Collections.Generic.List<System.Type> instance_of_this_method = (System.Collections.Generic.List<System.Type>)typeof(System.Collections.Generic.List<System.Type>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
+            __intp.Free(ptr_of_this_method);
+
+            var result_of_this_method = instance_of_this_method.GetEnumerator();
+
+            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
+        }
+
+
+
+    }
+}

+ 4 - 3
Unity/Assets/Scripts/Helper/DllHelper.cs.meta → Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_List_1_Type_Binding.cs.meta

@@ -1,8 +1,9 @@
 fileFormatVersion: 2
-guid: 20fbd2b0398f14a4d89abd01726d5d25
-timeCreated: 1498118075
-licenseType: Free
+guid: 54e08e729e2f1f5429804a6ba5786f21
+timeCreated: 1529041539
+licenseType: Pro
 MonoImporter:
+  externalObjects: {}
   serializedVersion: 2
   defaultReferences: []
   executionOrder: 0

+ 126 - 0
Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_List_1_Type_Binding_Enumerator_Bind_t.cs

@@ -0,0 +1,126 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+using ILRuntime.CLR.TypeSystem;
+using ILRuntime.CLR.Method;
+using ILRuntime.Runtime.Enviorment;
+using ILRuntime.Runtime.Intepreter;
+using ILRuntime.Runtime.Stack;
+using ILRuntime.Reflection;
+using ILRuntime.CLR.Utils;
+
+namespace ILRuntime.Runtime.Generated
+{
+    unsafe class System_Collections_Generic_List_1_Type_Binding_Enumerator_Binding
+    {
+        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
+        {
+            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
+            MethodBase method;
+            Type[] args;
+            Type type = typeof(System.Collections.Generic.List<System.Type>.Enumerator);
+            args = new Type[]{};
+            method = type.GetMethod("get_Current", flag, null, args, null);
+            app.RegisterCLRMethodRedirection(method, get_Current_0);
+            args = new Type[]{};
+            method = type.GetMethod("MoveNext", flag, null, args, null);
+            app.RegisterCLRMethodRedirection(method, MoveNext_1);
+
+            app.RegisterCLRCreateDefaultInstance(type, () => new System.Collections.Generic.List<System.Type>.Enumerator());
+
+
+        }
+
+        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref System.Collections.Generic.List<System.Type>.Enumerator instance_of_this_method)
+        {
+            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
+            switch(ptr_of_this_method->ObjectType)
+            {
+                case ObjectTypes.Object:
+                    {
+                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
+                    }
+                    break;
+                case ObjectTypes.FieldReference:
+                    {
+                        var ___obj = __mStack[ptr_of_this_method->Value];
+                        if(___obj is ILTypeInstance)
+                        {
+                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
+                        }
+                        else
+                        {
+                            var t = __domain.GetType(___obj.GetType()) as CLRType;
+                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
+                        }
+                    }
+                    break;
+                case ObjectTypes.StaticFieldReference:
+                    {
+                        var t = __domain.GetType(ptr_of_this_method->Value);
+                        if(t is ILType)
+                        {
+                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
+                        }
+                        else
+                        {
+                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
+                        }
+                    }
+                    break;
+                 case ObjectTypes.ArrayReference:
+                    {
+                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Collections.Generic.List<System.Type>.Enumerator[];
+                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
+                    }
+                    break;
+            }
+        }
+
+        static StackObject* get_Current_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        {
+            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
+            StackObject* ptr_of_this_method;
+            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
+
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
+            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
+            System.Collections.Generic.List<System.Type>.Enumerator instance_of_this_method = (System.Collections.Generic.List<System.Type>.Enumerator)typeof(System.Collections.Generic.List<System.Type>.Enumerator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
+
+            var result_of_this_method = instance_of_this_method.Current;
+
+            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
+
+            object obj_result_of_this_method = result_of_this_method;
+            if(obj_result_of_this_method is CrossBindingAdaptorType)
+            {    
+                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
+            }
+            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
+        }
+
+        static StackObject* MoveNext_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        {
+            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
+            StackObject* ptr_of_this_method;
+            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
+
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
+            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
+            System.Collections.Generic.List<System.Type>.Enumerator instance_of_this_method = (System.Collections.Generic.List<System.Type>.Enumerator)typeof(System.Collections.Generic.List<System.Type>.Enumerator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
+
+            var result_of_this_method = instance_of_this_method.MoveNext();
+
+            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
+
+            __ret->ObjectType = ObjectTypes.Integer;
+            __ret->Value = result_of_this_method ? 1 : 0;
+            return __ret + 1;
+        }
+
+
+
+    }
+}

+ 13 - 0
Unity/Assets/ThirdParty/ILRuntime/Generated/System_Collections_Generic_List_1_Type_Binding_Enumerator_Bind_t.cs.meta

@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: 09a9570fea5e288459dbfb4e0185f4de
+timeCreated: 1529041539
+licenseType: Pro
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 33 - 3
Unity/Assets/ThirdParty/ILRuntime/Generated/System_Linq_Enumerable_Binding.cs

@@ -48,7 +48,7 @@ namespace ILRuntime.Runtime.Generated
                     }
                 }
             }
-            args = new Type[]{typeof(System.String)};
+            args = new Type[]{typeof(System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>)};
             if (genericMethods.TryGetValue("ToArray", out lst))
             {
                 foreach(var m in lst)
@@ -62,6 +62,20 @@ namespace ILRuntime.Runtime.Generated
                     }
                 }
             }
+            args = new Type[]{typeof(System.String)};
+            if (genericMethods.TryGetValue("ToArray", out lst))
+            {
+                foreach(var m in lst)
+                {
+                    if(m.GetParameters().Length == 1)
+                    {
+                        method = m.MakeGenericMethod(args);
+                        app.RegisterCLRMethodRedirection(method, ToArray_2);
+
+                        break;
+                    }
+                }
+            }
             args = new Type[]{typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance)};
             if (genericMethods.TryGetValue("First", out lst))
             {
@@ -70,7 +84,7 @@ namespace ILRuntime.Runtime.Generated
                     if(m.GetParameters().Length == 1)
                     {
                         method = m.MakeGenericMethod(args);
-                        app.RegisterCLRMethodRedirection(method, First_2);
+                        app.RegisterCLRMethodRedirection(method, First_3);
 
                         break;
                     }
@@ -103,6 +117,22 @@ namespace ILRuntime.Runtime.Generated
             StackObject* ptr_of_this_method;
             StackObject* __ret = ILIntepreter.Minus(__esp, 1);
 
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
+            System.Collections.Generic.IEnumerable<System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>> @source = (System.Collections.Generic.IEnumerable<System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>)typeof(System.Collections.Generic.IEnumerable<System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
+            __intp.Free(ptr_of_this_method);
+
+
+            var result_of_this_method = System.Linq.Enumerable.ToArray<System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>(@source);
+
+            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
+        }
+
+        static StackObject* ToArray_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        {
+            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
+            StackObject* ptr_of_this_method;
+            StackObject* __ret = ILIntepreter.Minus(__esp, 1);
+
             ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
             System.Collections.Generic.IEnumerable<System.String> @source = (System.Collections.Generic.IEnumerable<System.String>)typeof(System.Collections.Generic.IEnumerable<System.String>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
             __intp.Free(ptr_of_this_method);
@@ -113,7 +143,7 @@ namespace ILRuntime.Runtime.Generated
             return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
         }
 
-        static StackObject* First_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        static StackObject* First_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
         {
             ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
             StackObject* ptr_of_this_method;

+ 1 - 1
Unity/Hotfix/Base/Object/EventSystem.cs

@@ -37,7 +37,7 @@ namespace ETHotfix
 
 		public EventSystem()
 		{
-			Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
+			List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
 			foreach (Type type in types)
 			{
 				object[] attrs = type.GetCustomAttributes(typeof(ObjectSystemAttribute), false);

+ 1 - 1
Unity/Hotfix/Module/Config/ConfigComponent.cs

@@ -37,7 +37,7 @@ namespace ETHotfix
 		public void Load()
 		{
 			this.allConfig.Clear();
-			Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
+			List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
 
 			foreach (Type type in types)
 			{

+ 1 - 1
Unity/Hotfix/Module/Message/MessageDispatherComponent.cs

@@ -41,7 +41,7 @@ namespace ETHotfix
 			ETModel.MessageDispatherComponent messageDispatherComponent = ETModel.Game.Scene.GetComponent<ETModel.MessageDispatherComponent>();
 			ETModel.OpcodeTypeComponent opcodeTypeComponent = ETModel.Game.Scene.GetComponent<ETModel.OpcodeTypeComponent>();
 
-			Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
+			List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
 
 			foreach (Type type in types)
 			{

+ 2 - 1
Unity/Hotfix/Module/Message/OpcodeTypeComponent.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using ETModel;
 using ProtoBuf;
 
@@ -19,7 +20,7 @@ namespace ETHotfix
 
 		public void Awake()
 		{
-			Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
+			List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
 			foreach (Type type in types)
 			{
 				object[] attrs = type.GetCustomAttributes(typeof(MessageAttribute), false);

+ 1 - 1
Unity/Hotfix/Module/UI/UIComponent.cs

@@ -67,7 +67,7 @@ namespace ETHotfix
 		{
 			UiTypes.Clear();
             
-            Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
+			List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
 
 			foreach (Type type in types)
 			{

+ 6 - 8
Unity/Unity.csproj

@@ -12,16 +12,13 @@
     <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
-    <TargetFrameworkProfile>
-    </TargetFrameworkProfile>
-    <CompilerResponseFile>
-    </CompilerResponseFile>
+    <TargetFrameworkProfile></TargetFrameworkProfile>
+    <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectGenerator>VSTU</UnityProjectGenerator>
     <UnityProjectType>Game:1</UnityProjectType>
     <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.4.3f1</UnityVersion>
-    <RootNamespace>
-    </RootNamespace>
+    <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
   </PropertyGroup>
   <PropertyGroup>
@@ -355,7 +352,6 @@
     <Compile Include="Assets\Scripts\G2C_TestHandler.cs" />
     <Compile Include="Assets\Scripts\Helper\ActionHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\BundleHelper.cs" />
-    <Compile Include="Assets\Scripts\Helper\DllHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\GameObjectHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\ILHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\PathHelper.cs" />
@@ -562,6 +558,8 @@
     <Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_ILTypeInstance_Binding_Enume_t.cs" />
     <Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_Object_Binding.cs" />
     <Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_String_Binding.cs" />
+    <Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_Type_Binding.cs" />
+    <Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_Type_Binding_Enumerator_Bind_t.cs" />
     <Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_UnitInfo_Binding.cs" />
     <Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_UnitInfo_Binding_Enumerator__t.cs" />
     <Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_Queue_1_ILTypeInstance_Binding.cs" />
@@ -936,4 +934,4 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />
-</Project>
+</Project>