Răsfoiți Sursa

更新ILRuntime,蓝大官方支持了Unity2018.3

tanghai 7 ani în urmă
părinte
comite
c8634e2e26
71 a modificat fișierele cu 1094 adăugiri și 472 ștergeri
  1. 3 2
      Unity/Assets/Model/ILBinding/CLRBindings.cs
  2. 11 11
      Unity/Assets/Model/ILBinding/ETModel_AsyncETVoidMethodBuilder_Binding.cs
  3. 1 1
      Unity/Assets/Model/ILBinding/ETModel_ComponentFactory_Binding.cs
  4. 46 0
      Unity/Assets/Model/ILBinding/ETModel_Define_Binding.cs
  5. 11 0
      Unity/Assets/Model/ILBinding/ETModel_Define_Binding.cs.meta
  6. 0 5
      Unity/Assets/Model/ILBinding/ETModel_DoubleMap_2_UInt16_Type_Binding.cs
  7. 11 11
      Unity/Assets/Model/ILBinding/ETModel_Entity_Binding.cs
  8. 1 6
      Unity/Assets/Model/ILBinding/ETModel_GameObjectHelper_Binding.cs
  9. 0 5
      Unity/Assets/Model/ILBinding/ETModel_GizmosDebug_Binding.cs
  10. 0 5
      Unity/Assets/Model/ILBinding/ETModel_Hotfix_Binding.cs
  11. 0 5
      Unity/Assets/Model/ILBinding/ETModel_NetworkComponent_Binding.cs
  12. 0 5
      Unity/Assets/Model/ILBinding/ETModel_ResourcesComponent_Binding.cs
  13. 0 5
      Unity/Assets/Model/ILBinding/ETModel_UnOrderMultiMap_2_Type_ILTypeInstance_Binding.cs
  14. 1 1
      Unity/Assets/Model/ILBinding/Google_Protobuf_FieldCodec_Binding.cs
  15. 1 1
      Unity/Assets/Model/ILBinding/Google_Protobuf_ProtoPreconditions_Binding.cs
  16. 1 1
      Unity/Assets/Model/ILBinding/ReferenceCollector_Binding.cs
  17. 1 1
      Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_Int32_Action_1_Google_Protobuf_Adapt__t.cs
  18. 1 1
      Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_Int64_ILTypeInstance_Binding.cs
  19. 1 1
      Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_String_ILTypeInstance_Binding.cs
  20. 1 6
      Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_String_List_1_ILTypeInstance_Binding.cs
  21. 1 1
      Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_Type_ILTypeInstance_Binding.cs
  22. 1 1
      Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_Type_Queue_1_Object_Binding.cs
  23. 1 6
      Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_UInt16_List_1_ILTypeInstance_Binding.cs
  24. 26 2
      Unity/Assets/Model/ILBinding/System_Collections_Generic_HashSet_1_ILTypeInstance_Binding.cs
  25. 0 5
      Unity/Assets/Model/ILBinding/System_Collections_Generic_List_1_Type_Binding_Enumerator_Binding.cs
  26. 0 5
      Unity/Assets/Model/ILBinding/System_Collections_IEnumerable_Binding.cs
  27. 0 5
      Unity/Assets/Model/ILBinding/System_Exception_Binding.cs
  28. 3 3
      Unity/Assets/Model/ILBinding/System_Linq_Enumerable_Binding.cs
  29. 0 5
      Unity/Assets/Model/ILBinding/System_Object_Binding.cs
  30. 0 5
      Unity/Assets/Model/ILBinding/System_Reflection_PropertyInfo_Binding.cs
  31. 0 5
      Unity/Assets/Model/ILBinding/System_Runtime_CompilerServices_TaskAwaiter_1_IResponse_Binding.cs
  32. 0 5
      Unity/Assets/Model/ILBinding/System_Type_Binding.cs
  33. 7 37
      Unity/Assets/Model/ILBinding/UnityEngine_GameObject_Binding.cs
  34. 1 1
      Unity/Assets/Model/ILBinding/UnityEngine_Object_Binding.cs
  35. 1 1
      Unity/Assets/Model/ILBinding/UnityEngine_Physics_Binding.cs
  36. 0 5
      Unity/Assets/Model/ILBinding/UnityEngine_Transform_Binding.cs
  37. 0 5
      Unity/Assets/Model/ILBinding/UnityEngine_UI_Button_Binding.cs
  38. 1 2
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime.meta
  39. 37 2
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Method/CLRMethod.cs
  40. 2 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Method/ILMethod.cs
  41. 95 2
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/TypeSystem/CLRType.cs
  42. 4 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/TypeSystem/ILGenericParameterType.cs
  43. 2 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/TypeSystem/IType.cs
  44. 2 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Utils/Extensions.cs
  45. 2 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeConstructorInfo.cs
  46. 3 2
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeMethodInfo.cs
  47. 7 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeParameterInfo.cs
  48. 3 3
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimePropertyInfo.cs
  49. 53 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeType.cs
  50. 21 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeWrapperType.cs
  51. 2 2
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/CLRBinding/BindingCodeGenerator.cs
  52. 39 4
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/CLRBinding/BindingGeneratorExtensions.cs
  53. 1 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/CLRBinding/ConstructorBindingGenerator.cs
  54. 49 26
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/CLRBinding/MethodBindingGenerator.cs
  55. 163 22
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Debugger/DebugService.cs
  56. 67 16
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Debugger/DebuggerServer/DebuggerServer.cs
  57. 1 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Debugger/VariableInfo.cs
  58. 34 7
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/AppDomain.cs
  59. 62 2
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/CLRRedirections.cs
  60. 9 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/CrossBindingAdaptor.cs
  61. 5 5
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/ValueTypeBinder.cs
  62. 90 1
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Extensions.cs
  63. 10 0
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/DelegateAdapter.cs
  64. 173 154
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/ILIntepreter.cs
  65. 3 3
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/ILTypeInstance.cs
  66. 14 14
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Stack/RuntimeStack.cs
  67. 3 23
      Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Stack/StackObject.cs
  68. 1 2
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20.meta
  69. 1 2
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb.meta
  70. 2 3
      Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb/pdb/Mono.Cecil.Pdb/PdbReader.cs
  71. 1 0
      Unity/Unity.Model.csproj

+ 3 - 2
Unity/Assets/Model/ILBinding/CLRBindings.cs

@@ -45,8 +45,6 @@ namespace ILRuntime.Runtime.Generated
             System_Collections_Generic_Dictionary_2_Type_ILTypeInstance_Binding_ValueCollection_Binding_Enumerator_Binding.Register(app);
             System_Collections_Generic_HashSet_1_ILTypeInstance_Binding.Register(app);
             System_Linq_Enumerable_Binding.Register(app);
-            System_Collections_Generic_Dictionary_2_Type_ILTypeInstance_Binding_Enumerator_Binding.Register(app);
-            System_Collections_Generic_KeyValuePair_2_Type_ILTypeInstance_Binding.Register(app);
             System_Collections_Generic_HashSet_1_ILTypeInstance_Binding_Enumerator_Binding.Register(app);
             System_Collections_Generic_List_1_Object_Binding.Register(app);
             System_Collections_Generic_Dictionary_2_String_List_1_ILTypeInstance_Binding.Register(app);
@@ -63,6 +61,9 @@ namespace ILRuntime.Runtime.Generated
             ETModel_EventProxy_Binding.Register(app);
             ETModel_EventSystem_Binding.Register(app);
             System_Collections_Generic_Queue_1_ILTypeInstance_Binding.Register(app);
+            System_Collections_Generic_Dictionary_2_Type_ILTypeInstance_Binding_Enumerator_Binding.Register(app);
+            System_Collections_Generic_KeyValuePair_2_Type_ILTypeInstance_Binding.Register(app);
+            ETModel_Define_Binding.Register(app);
             ETModel_Entity_Binding.Register(app);
             ETModel_ResourcesComponent_Binding.Register(app);
             ETModel_ConfigAttribute_Binding.Register(app);

+ 11 - 11
Unity/Assets/Model/ILBinding/ETModel_AsyncETVoidMethodBuilder_Binding.cs

@@ -44,7 +44,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 1)
+                    if(m.MatchGenericParameters(args, typeof(void), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).MakeByRefType()))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, Start_1);
@@ -61,7 +61,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 2)
+                    if(m.MatchGenericParameters(args, typeof(void), typeof(ETModel.ETTask<Google.Protobuf.Adapt_IMessage.Adaptor>.Awaiter).MakeByRefType(), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).MakeByRefType()))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, AwaitUnsafeOnCompleted_3);
@@ -81,7 +81,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 2)
+                    if(m.MatchGenericParameters(args, typeof(void), typeof(ETModel.ETTask.Awaiter).MakeByRefType(), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).MakeByRefType()))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, AwaitUnsafeOnCompleted_6);
@@ -95,7 +95,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 2)
+                    if(m.MatchGenericParameters(args, typeof(void), typeof(System.Runtime.CompilerServices.TaskAwaiter<ETModel.IResponse>).MakeByRefType(), typeof(ETModel.IAsyncStateMachineClassInheritanceAdaptor.IAsyncStateMachineAdaptor).MakeByRefType()))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, AwaitUnsafeOnCompleted_7);
@@ -187,7 +187,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @stateMachine;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {
@@ -286,7 +286,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @stateMachine;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {
@@ -341,7 +341,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @awaiter;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {
@@ -463,7 +463,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @stateMachine;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {
@@ -518,7 +518,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @awaiter;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {
@@ -598,7 +598,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @stateMachine;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {
@@ -653,7 +653,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @awaiter;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 1 - 1
Unity/Assets/Model/ILBinding/ETModel_ComponentFactory_Binding.cs

@@ -40,7 +40,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 2)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.Player), typeof(System.Int64), typeof(System.Boolean)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, CreateWithId_0);

+ 46 - 0
Unity/Assets/Model/ILBinding/ETModel_Define_Binding.cs

@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+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 ETModel_Define_Binding
+    {
+        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
+        {
+            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
+            FieldInfo field;
+            Type[] args;
+            Type type = typeof(ETModel.Define);
+
+            field = type.GetField("IsILRuntime", flag);
+            app.RegisterCLRFieldGetter(field, get_IsILRuntime_0);
+            app.RegisterCLRFieldSetter(field, set_IsILRuntime_0);
+
+
+        }
+
+
+
+        static object get_IsILRuntime_0(ref object o)
+        {
+            return ETModel.Define.IsILRuntime;
+        }
+        static void set_IsILRuntime_0(ref object o, object v)
+        {
+            ETModel.Define.IsILRuntime = (System.Boolean)v;
+        }
+
+
+    }
+}

+ 11 - 0
Unity/Assets/Model/ILBinding/ETModel_Define_Binding.cs.meta

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

+ 0 - 5
Unity/Assets/Model/ILBinding/ETModel_DoubleMap_2_UInt16_Type_Binding.cs

@@ -115,11 +115,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetValueByKey(@key);
 
-            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);
         }
 

+ 11 - 11
Unity/Assets/Model/ILBinding/ETModel_Entity_Binding.cs

@@ -40,7 +40,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.ResourcesComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_0);
@@ -54,7 +54,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.NetOuterComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_1);
@@ -68,7 +68,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.SessionComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, AddComponent_2);
@@ -82,7 +82,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.PlayerComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_3);
@@ -96,7 +96,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.SceneChangeComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, AddComponent_4);
@@ -110,7 +110,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.UnitComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_5);
@@ -124,7 +124,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.AnimatorComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_6);
@@ -138,7 +138,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.UnitPathComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_7);
@@ -152,7 +152,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.MessageDispatcherComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_8);
@@ -166,7 +166,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.OpcodeTypeComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_9);
@@ -180,7 +180,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.SessionCallbackComponent)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, AddComponent_10);

+ 1 - 6
Unity/Assets/Model/ILBinding/ETModel_GameObjectHelper_Binding.cs

@@ -40,7 +40,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 2)
+                    if(m.MatchGenericParameters(args, typeof(UnityEngine.TextAsset), typeof(UnityEngine.GameObject), typeof(System.String)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, Get_0);
@@ -71,11 +71,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = ETModel.GameObjectHelper.Get<UnityEngine.TextAsset>(@gameObject, @key);
 
-            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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/ETModel_GizmosDebug_Binding.cs

@@ -43,11 +43,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = ETModel.GizmosDebug.Instance;
 
-            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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/ETModel_Hotfix_Binding.cs

@@ -53,11 +53,6 @@ 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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/ETModel_NetworkComponent_Binding.cs

@@ -64,11 +64,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.MessagePacker;
 
-            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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/ETModel_ResourcesComponent_Binding.cs

@@ -97,11 +97,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetAsset(@bundleName, @prefab);
 
-            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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/ETModel_UnOrderMultiMap_2_Type_ILTypeInstance_Binding.cs

@@ -76,11 +76,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method[t];
 
-            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);
         }
 

+ 1 - 1
Unity/Assets/Model/ILBinding/Google_Protobuf_FieldCodec_Binding.cs

@@ -41,7 +41,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 2)
+                    if(m.MatchGenericParameters(args, typeof(Google.Protobuf.FieldCodec<Google.Protobuf.Adapt_IMessage.Adaptor>), typeof(System.UInt32), typeof(Google.Protobuf.MessageParser<Google.Protobuf.Adapt_IMessage.Adaptor>)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, ForMessage_0);

+ 1 - 1
Unity/Assets/Model/ILBinding/Google_Protobuf_ProtoPreconditions_Binding.cs

@@ -40,7 +40,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 2)
+                    if(m.MatchGenericParameters(args, typeof(System.String), typeof(System.String), typeof(System.String)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, CheckNotNull_0);

+ 1 - 1
Unity/Assets/Model/ILBinding/ReferenceCollector_Binding.cs

@@ -40,7 +40,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 1)
+                    if(m.MatchGenericParameters(args, typeof(UnityEngine.GameObject), typeof(System.String)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, Get_0);

+ 1 - 1
Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_Int32_Action_1_Google_Protobuf_Adapt__t.cs

@@ -97,7 +97,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @value;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 1 - 1
Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_Int64_ILTypeInstance_Binding.cs

@@ -106,7 +106,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @value;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 1 - 1
Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_String_ILTypeInstance_Binding.cs

@@ -120,7 +120,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @value;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 1 - 6
Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_String_List_1_ILTypeInstance_Binding.cs

@@ -105,11 +105,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method[key];
 
-            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);
         }
 
@@ -135,7 +130,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @value;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 1 - 1
Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_Type_ILTypeInstance_Binding.cs

@@ -150,7 +150,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @value;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 1 - 1
Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_Type_Queue_1_Object_Binding.cs

@@ -58,7 +58,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @value;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 1 - 6
Unity/Assets/Model/ILBinding/System_Collections_Generic_Dictionary_2_UInt16_List_1_ILTypeInstance_Binding.cs

@@ -117,11 +117,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method[key];
 
-            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);
         }
 
@@ -147,7 +142,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @value;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 26 - 2
Unity/Assets/Model/ILBinding/System_Collections_Generic_HashSet_1_ILTypeInstance_Binding.cs

@@ -28,9 +28,12 @@ namespace ILRuntime.Runtime.Generated
             args = new Type[]{typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance)};
             method = type.GetMethod("Add", flag, null, args, null);
             app.RegisterCLRMethodRedirection(method, Add_1);
+            args = new Type[]{typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance)};
+            method = type.GetMethod("Remove", flag, null, args, null);
+            app.RegisterCLRMethodRedirection(method, Remove_2);
             args = new Type[]{};
             method = type.GetMethod("GetEnumerator", flag, null, args, null);
-            app.RegisterCLRMethodRedirection(method, GetEnumerator_2);
+            app.RegisterCLRMethodRedirection(method, GetEnumerator_3);
 
             args = new Type[]{};
             method = type.GetConstructor(flag, null, args, null);
@@ -75,7 +78,28 @@ namespace ILRuntime.Runtime.Generated
             return __ret + 1;
         }
 
-        static StackObject* GetEnumerator_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
+        static StackObject* Remove_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, 2);
+
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
+            ILRuntime.Runtime.Intepreter.ILTypeInstance @item = (ILRuntime.Runtime.Intepreter.ILTypeInstance)typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
+            __intp.Free(ptr_of_this_method);
+
+            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
+            System.Collections.Generic.HashSet<ILRuntime.Runtime.Intepreter.ILTypeInstance> instance_of_this_method = (System.Collections.Generic.HashSet<ILRuntime.Runtime.Intepreter.ILTypeInstance>)typeof(System.Collections.Generic.HashSet<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.Remove(@item);
+
+            __ret->ObjectType = ObjectTypes.Integer;
+            __ret->Value = result_of_this_method ? 1 : 0;
+            return __ret + 1;
+        }
+
+        static StackObject* GetEnumerator_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
         {
             ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
             StackObject* ptr_of_this_method;

+ 0 - 5
Unity/Assets/Model/ILBinding/System_Collections_Generic_List_1_Type_Binding_Enumerator_Binding.cs

@@ -96,11 +96,6 @@ namespace ILRuntime.Runtime.Generated
             WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
 
             __intp.Free(ptr_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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/System_Collections_IEnumerable_Binding.cs

@@ -42,11 +42,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetEnumerator();
 
-            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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/System_Exception_Binding.cs

@@ -48,11 +48,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.Data;
 
-            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);
         }
 

+ 3 - 3
Unity/Assets/Model/ILBinding/System_Linq_Enumerable_Binding.cs

@@ -40,7 +40,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 1)
+                    if(m.MatchGenericParameters(args, typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance[]), typeof(System.Collections.Generic.IEnumerable<ILRuntime.Runtime.Intepreter.ILTypeInstance>)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, ToArray_0);
@@ -54,7 +54,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 1)
+                    if(m.MatchGenericParameters(args, typeof(System.Action<Google.Protobuf.Adapt_IMessage.Adaptor>[]), typeof(System.Collections.Generic.IEnumerable<System.Action<Google.Protobuf.Adapt_IMessage.Adaptor>>)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, ToArray_1);
@@ -68,7 +68,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 1)
+                    if(m.MatchGenericParameters(args, typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance), typeof(System.Collections.Generic.IEnumerable<ILRuntime.Runtime.Intepreter.ILTypeInstance>)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, First_2);

+ 0 - 5
Unity/Assets/Model/ILBinding/System_Object_Binding.cs

@@ -45,11 +45,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetType();
 
-            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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/System_Reflection_PropertyInfo_Binding.cs

@@ -42,11 +42,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetGetMethod();
 
-            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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/System_Runtime_CompilerServices_TaskAwaiter_1_IResponse_Binding.cs

@@ -117,11 +117,6 @@ namespace ILRuntime.Runtime.Generated
             WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
 
             __intp.Free(ptr_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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/System_Type_Binding.cs

@@ -143,11 +143,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = System.Type.GetTypeFromHandle(@handle);
 
-            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);
         }
 

+ 7 - 37
Unity/Assets/Model/ILBinding/UnityEngine_GameObject_Binding.cs

@@ -47,7 +47,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(ETModel.ComponentView)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, AddComponent_2);
@@ -64,7 +64,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(global::ReferenceCollector)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_4);
@@ -78,7 +78,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(UnityEngine.UI.Button)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_5);
@@ -92,7 +92,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(UnityEngine.UI.Text)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_6);
@@ -106,7 +106,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(UnityEngine.UI.InputField)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_7);
@@ -120,7 +120,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(UnityEngine.Canvas)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_8);
@@ -134,7 +134,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 0)
+                    if(m.MatchGenericParameters(args, typeof(UnityEngine.Camera)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, GetComponent_9);
@@ -163,11 +163,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.transform;
 
-            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);
         }
 
@@ -201,11 +196,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.AddComponent<ETModel.ComponentView>();
 
-            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);
         }
 
@@ -237,11 +227,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetComponent<global::ReferenceCollector>();
 
-            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);
         }
 
@@ -257,11 +242,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.Button>();
 
-            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);
         }
 
@@ -277,11 +257,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.Text>();
 
-            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);
         }
 
@@ -297,11 +272,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.InputField>();
 
-            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);
         }
 

+ 1 - 1
Unity/Assets/Model/ILBinding/UnityEngine_Object_Binding.cs

@@ -50,7 +50,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == 1)
+                    if(m.MatchGenericParameters(args, typeof(UnityEngine.GameObject), typeof(UnityEngine.GameObject)))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, Instantiate_3);

+ 1 - 1
Unity/Assets/Model/ILBinding/UnityEngine_Physics_Binding.cs

@@ -60,7 +60,7 @@ namespace ILRuntime.Runtime.Generated
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         object ___obj = @hitInfo;
                         if (___dst->ObjectType >= ObjectTypes.Object)
                         {

+ 0 - 5
Unity/Assets/Model/ILBinding/UnityEngine_Transform_Binding.cs

@@ -89,11 +89,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.Find(@n);
 
-            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);
         }
 

+ 0 - 5
Unity/Assets/Model/ILBinding/UnityEngine_UI_Button_Binding.cs

@@ -42,11 +42,6 @@ namespace ILRuntime.Runtime.Generated
 
             var result_of_this_method = instance_of_this_method.onClick;
 
-            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);
         }
 

+ 1 - 2
Unity/Assets/ThirdParty/ILRuntime/ILRuntime.meta

@@ -1,9 +1,8 @@
 fileFormatVersion: 2
 guid: 87596c56637b1f840a506371ff9e9e6a
 folderAsset: yes
-timeCreated: 1486603934
-licenseType: Pro
 DefaultImporter:
+  externalObjects: {}
   userData: 
   assetBundleName: 
   assetBundleVariant: 

+ 37 - 2
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Method/CLRMethod.cs

@@ -17,12 +17,14 @@ namespace ILRuntime.CLR.Method
         MethodInfo def;
         ConstructorInfo cDef;
         List<IType> parameters;
+        ParameterInfo[] parametersCLR;
         ILRuntime.Runtime.Enviorment.AppDomain appdomain;
         CLRType declaringType;
         ParameterInfo[] param;
         bool isConstructor;
         CLRRedirectionDelegate redirect;
         IType[] genericArguments;
+        Type[] genericArgumentsCLR;
         object[] invocationParam;
         bool isDelegateInvoke;
         int hashCode = -1;
@@ -95,6 +97,21 @@ namespace ILRuntime.CLR.Method
 
         public IType[] GenericArguments { get { return genericArguments; } }
 
+        public Type[] GenericArgumentsCLR
+        {
+            get
+            {
+                if(genericArgumentsCLR == null)
+                {
+                    if (cDef != null)
+                        genericArgumentsCLR = cDef.GetGenericArguments();
+                    else
+                        genericArgumentsCLR = def.GetGenericArguments();
+                }
+                return genericArgumentsCLR;
+            }
+        }
+
         internal CLRMethod(MethodInfo def, CLRType type, ILRuntime.Runtime.Enviorment.AppDomain domain)
         {
             this.def = def;
@@ -164,6 +181,21 @@ namespace ILRuntime.CLR.Method
             }
         }
 
+        public ParameterInfo[] ParametersCLR
+        {
+            get
+            {
+                if(parametersCLR == null)
+                {
+                    if (cDef != null)
+                        parametersCLR = cDef.GetParameters();
+                    else
+                        parametersCLR = def.GetParameters();
+                }
+                return parametersCLR;
+            }
+        }
+
         public IType ReturnType
         {
             get;
@@ -268,7 +300,9 @@ namespace ILRuntime.CLR.Method
 
                 if (!def.IsStatic)
                 {
-                    instance = declaringType.TypeForCLR.CheckCLRTypes(StackObject.ToObject((Minus(esp, paramCount + 1)), appdomain, mStack));
+                    instance = StackObject.ToObject((Minus(esp, paramCount + 1)), appdomain, mStack);
+                    if (!(instance is Reflection.ILRuntimeWrapperType))
+                        instance = declaringType.TypeForCLR.CheckCLRTypes(instance);
                     if (declaringType.IsValueType)
                         instance = ILIntepreter.CheckAndCloneValueType(instance, appdomain);
                     if (instance == null)
@@ -298,7 +332,8 @@ namespace ILRuntime.CLR.Method
                 {
                     case ObjectTypes.StackObjectReference:
                         {
-                            var dst = p->ValueLong;
+                            var addr = *(long*)&p->Value;
+                            var dst = (StackObject*)addr;
                             if (dst->ObjectType >= ObjectTypes.Object)
                             {
                                 var obj = val;

+ 2 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Method/ILMethod.cs

@@ -527,6 +527,8 @@ namespace ILRuntime.CLR.Method
             if (token is TypeReference)
             {
                 TypeReference _ref = ((TypeReference)token);
+                if (_ref.IsArray)
+                    return CheckHasGenericParamter(_ref.GetElementType());
                 if (_ref.IsGenericParameter)
                     return true;
                 if (_ref.IsGenericInstance)

+ 95 - 2
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/TypeSystem/CLRType.cs

@@ -14,7 +14,7 @@ namespace ILRuntime.CLR.TypeSystem
     public class CLRType : IType
     {
         Type clrType;
-        bool isPrimitive, isValueType;
+        bool isPrimitive, isValueType, isEnum;
         Dictionary<string, List<CLRMethod>> methods;
         ILRuntime.Runtime.Enviorment.AppDomain appdomain;
         List<CLRMethod> constructors;
@@ -95,6 +95,7 @@ namespace ILRuntime.CLR.TypeSystem
             this.clrType = clrType;
             this.appdomain = appdomain;
             isPrimitive = clrType.IsPrimitive;
+            isEnum = clrType.IsEnum;
             isValueType = clrType.IsValueType;
             isDelegate = clrType.BaseType == typeof(MulticastDelegate);
         }
@@ -121,6 +122,16 @@ namespace ILRuntime.CLR.TypeSystem
         {
             get
             {
+                if (genericArguments != null)
+                {
+                    foreach(var i in genericArguments)
+                    {
+                        if(i.Value is ILType && i.Value.HasGenericParameter)
+                        {
+                            return true;
+                        }
+                    }
+                }
                 return clrType.ContainsGenericParameters;
             }
         }
@@ -211,6 +222,14 @@ namespace ILRuntime.CLR.TypeSystem
                 return isPrimitive;
             }
         }
+
+        public bool IsEnum
+        {
+            get
+            {
+                return isEnum;
+            }
+        }
         public string FullName
         {
             get
@@ -541,6 +560,72 @@ namespace ILRuntime.CLR.TypeSystem
             return null;
         }
 
+        bool MatchGenericParameters(Type[] args, Type type, Type q, IType[] genericArguments)
+        {
+            if (type.IsGenericParameter)
+            {
+                for (int i = 0; i < args.Length; i++)
+                {
+                    if (args[i] == type)
+                    {
+                        return q == genericArguments[i].TypeForCLR;
+                    }
+                }
+                throw new NotSupportedException();
+            }
+            else
+            {
+                if (type.IsArray)
+                {
+                    if (q.IsArray)
+                    {
+                        return MatchGenericParameters(args, type.GetElementType(), q.GetElementType(), genericArguments);
+                    }
+                    else
+                        return false;
+                }
+                else if (type.IsByRef)
+                {
+                    if (q.IsByRef)
+                    {
+                        return MatchGenericParameters(args, type.GetElementType(), q.GetElementType(), genericArguments);
+                    }
+                    else
+                        return false;
+                }
+                else if (type.IsGenericType)
+                {
+                    if (q.IsGenericType)
+                    {
+                        var t1 = type.GetGenericTypeDefinition();
+                        var t2 = type.GetGenericTypeDefinition();
+                        if (t1 == t2)
+                        {
+                            var argA = type.GetGenericArguments();
+                            var argB = q.GetGenericArguments();
+                            if (argA.Length == argB.Length)
+                            {
+                                for (int i = 0; i < argA.Length; i++)
+                                {
+                                    if (!MatchGenericParameters(args, argA[i], argB[i], genericArguments))
+                                        return false;
+                                }
+                                return true;
+                            }
+                            else
+                                return false;
+                        }
+                        else
+                            return false;
+                    }
+                    else
+                        return false;
+                }
+                else
+                    return type == q;
+            }
+        }
+
         public IMethod GetMethod(string name, List<IType> param, IType[] genericArguments, IType returnType = null, bool declaredOnly = false)
         {
             if (methods == null)
@@ -564,7 +649,13 @@ namespace ILRuntime.CLR.TypeSystem
                                 if (i.Parameters[j].HasGenericParameter)
                                 {
                                     //TODO should match the generic parameters;
-                                    continue;
+                                    if (!MatchGenericParameters(i.GenericArgumentsCLR, i.ParametersCLR[j].ParameterType, q, genericArguments))
+                                    {
+                                        match = false;
+                                        break;
+                                    }
+                                    else
+                                        continue;
                                 }
                                 if (q != p)
                                 {
@@ -588,6 +679,8 @@ namespace ILRuntime.CLR.TypeSystem
                                 else
                                     match = i.GenericArguments.Length == genericArguments.Length;
                             }
+                            if (!match)
+                                continue;
                             for (int j = 0; j < param.Count; j++)
                             {
                                 var typeA = param[j].TypeForCLR.IsByRef ? param[j].TypeForCLR.GetElementType() : param[j].TypeForCLR;

+ 4 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/TypeSystem/ILGenericParameterType.cs

@@ -134,7 +134,10 @@ namespace ILRuntime.CLR.TypeSystem
         {
             get { return false; }
         }
-
+        public bool IsEnum
+        {
+            get { return false; }
+        }
         public bool IsInterface
         {
             get { return false; }

+ 2 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/TypeSystem/IType.cs

@@ -36,6 +36,8 @@ namespace ILRuntime.CLR.TypeSystem
 
         bool IsPrimitive { get; }
 
+        bool IsEnum { get; }
+
         bool IsByRef { get; }
 
         bool IsInterface { get; }

+ 2 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/CLR/Utils/Extensions.cs

@@ -78,6 +78,8 @@ namespace ILRuntime.CLR.Utils
                         }
                         if (t == null)
                             t = appdomain.GetType(name);
+                        if (t != null && i.ParameterType.IsByReference)
+                            t = t.MakeByRefType();
                     }
 
                     param.Add(t);

+ 2 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeConstructorInfo.cs

@@ -20,7 +20,8 @@ namespace ILRuntime.Reflection
             parameters = new ILRuntimeParameterInfo[m.ParameterCount];
             for(int i = 0; i < m.ParameterCount; i++)
             {
-                parameters[i] = new ILRuntimeParameterInfo(m.Parameters[i]);
+                var pd = m.Definition.Parameters[i];
+                parameters[i] = new ILRuntimeParameterInfo(pd, m.Parameters[i], this);
             }
         }
 

+ 3 - 2
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeMethodInfo.cs

@@ -27,7 +27,8 @@ namespace ILRuntime.Reflection
             parameters = new ILRuntimeParameterInfo[m.ParameterCount];
             for (int i = 0; i < m.ParameterCount; i++)
             {
-                parameters[i] = new ILRuntimeParameterInfo(m.Parameters[i]);
+                var pd = m.Definition.Parameters[i];
+                parameters[i] = new ILRuntimeParameterInfo(pd, m.Parameters[i], this);
             }
         }
 
@@ -135,7 +136,7 @@ namespace ILRuntime.Reflection
 
         public override ParameterInfo[] GetParameters()
         {
-            throw new NotImplementedException();
+            return parameters;
         }
 
         public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)

+ 7 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeParameterInfo.cs

@@ -12,10 +12,16 @@ namespace ILRuntime.Reflection
     public class ILRuntimeParameterInfo : ParameterInfo
     {
         IType type;
+        MethodBase method;
+        Mono.Cecil.ParameterDefinition definition;
 
-        public ILRuntimeParameterInfo(IType type)
+        public ILRuntimeParameterInfo(Mono.Cecil.ParameterDefinition definition, IType type, MethodBase method)
         {
             this.type = type;
+            this.method = method;
+            this.MemberImpl = method;
+            this.definition = definition;
+            NameImpl = definition.Name;
         }
         public override Type ParameterType
         {

+ 3 - 3
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimePropertyInfo.cs

@@ -223,7 +223,7 @@ namespace ILRuntime.Reflection
                         ctx.PushObject(obj);
                     for (int i = 0; i < getter.ParameterCount; i++)
                     {
-                        ctx.PushObject(index[i], !getter.Parameters[i].IsPrimitive);
+                        ctx.PushObject(index[i], !getter.Parameters[i].IsValueType);
                     }
                     ctx.Invoke();
                     return ctx.ReadObject(getter.ReturnType.TypeForCLR);
@@ -244,9 +244,9 @@ namespace ILRuntime.Reflection
                         ctx.PushObject(obj);
                     for (int i = 0; i < setter.ParameterCount - 1; i++)
                     {
-                        ctx.PushObject(index[i], !setter.Parameters[i].IsPrimitive);
+                        ctx.PushObject(index[i], !setter.Parameters[i].IsValueType);
                     }
-                    ctx.PushObject(value, !setter.Parameters[setter.ParameterCount - 1].IsPrimitive);
+                    ctx.PushObject(value, !setter.Parameters[setter.ParameterCount - 1].IsValueType);
                     ctx.Invoke();
                 }
             }

+ 53 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeType.cs

@@ -88,6 +88,25 @@ namespace ILRuntime.Reflection
             }
         }
 
+        public override Type MakeGenericType(params Type[] typeArguments)
+        {
+            if (ILType.TypeReference.HasGenericParameters)
+            {
+                KeyValuePair<string, IType>[] ga = new KeyValuePair<string, IType>[typeArguments.Length];
+                for (int i = 0; i < ga.Length; i++)
+                {
+                    string key = ILType.TypeReference.GenericParameters[0].Name;
+                    if (typeArguments[i] is ILRuntimeType)
+                        ga[i] = new KeyValuePair<string, IType>(key, ((ILRuntimeType)typeArguments[i]).ILType);
+                    else
+                        ga[i] = new KeyValuePair<string, IType>(key, ILType.AppDomain.GetType(typeArguments[i]));
+                }
+                return ILType.MakeGenericInstance(ga).ReflectionType;
+            }
+            else
+                throw new NotSupportedException();
+        }
+
         void InitializeFields()
         {
             int staticCnt = type.StaticFieldTypes != null ? type.StaticFieldTypes.Length : 0;
@@ -215,6 +234,33 @@ namespace ILRuntime.Reflection
             return res.ToArray();
         }
 
+        public override bool IsAssignableFrom(Type c)
+        {
+            IType type;
+            if (c is ILRuntimeWrapperType)
+            {
+                type = ((ILRuntimeWrapperType)c).CLRType;
+            }
+            else if (c is ILRuntimeType)
+            {
+                type = ((ILRuntimeType)c).ILType;
+            }
+            else
+                type = ILType.AppDomain.GetType(c);
+            return type.CanAssignTo(ILType);
+        }
+
+        public override bool IsInstanceOfType(object o)
+        {
+            if (o == null)
+            {
+                return false;
+            }
+
+            var instance = o as ILTypeInstance;
+            return IsAssignableFrom(instance != null ? instance.Type.ReflectionType : o.GetType());
+        }
+
         public override Type GetElementType()
         {
             if (type.IsArray)
@@ -468,6 +514,13 @@ namespace ILRuntime.Reflection
                 if (i.Name == name)
                     return i;
             }
+            if ((bindingAttr & BindingFlags.DeclaredOnly) != BindingFlags.DeclaredOnly)
+            {
+                if (BaseType != null && BaseType is ILRuntimeWrapperType)
+                {
+                    return BaseType.GetProperty(name, bindingAttr);
+                }
+            }
             return null;
         }
 

+ 21 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Reflection/ILRuntimeWrapperType.cs

@@ -154,7 +154,7 @@ namespace ILRuntime.Reflection
 
         protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
         {
-            return et.GetProperty(name, bindingAttr, binder, returnType, types, modifiers);
+            return et.GetProperty(name, bindingAttr);
         }
 
         public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
@@ -172,6 +172,26 @@ namespace ILRuntime.Reflection
             return type.GetHashCode();
         }
 
+        public override bool IsAssignableFrom(Type c)
+        {
+            if (c is ILRuntimeWrapperType)
+                c = ((ILRuntimeWrapperType)c).RealType;
+            if (c is ILRuntimeType)
+                c = ((ILRuntimeType)c).ILType.TypeForCLR;
+            return et.IsAssignableFrom(c);
+        }
+
+        public override bool IsInstanceOfType(object o)
+        {
+            if (o == null)
+            {
+                return false;
+            }
+
+            var instance = o as ILTypeInstance;
+            return IsAssignableFrom(instance != null ? instance.Type.ReflectionType : o.GetType());
+        }
+
         public override Type GetNestedType(string name, BindingFlags bindingAttr)
         {
             return et.GetNestedType(name, bindingAttr);

+ 2 - 2
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/CLRBinding/BindingCodeGenerator.cs

@@ -76,7 +76,7 @@ namespace ILRuntime.Runtime.Generated
                     string commonCode = i.GenerateCommonCode(realClsName);
                     ConstructorInfo[] ctors = i.GetConstructors(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly);
                     string ctorRegisterCode = i.GenerateConstructorRegisterCode(ctors, excludeMethods);
-                    string methodWraperCode = i.GenerateMethodWraperCode(methods, realClsName, excludeMethods, valueTypeBinders);
+                    string methodWraperCode = i.GenerateMethodWraperCode(methods, realClsName, excludeMethods, valueTypeBinders, null);
                     string fieldWraperCode = i.GenerateFieldWraperCode(fields, realClsName, excludeFields);
                     string cloneWraperCode = i.GenerateCloneWraperCode(fields, realClsName);
                     string ctorWraperCode = i.GenerateConstructorWraperCode(ctors, realClsName, excludeMethods, valueTypeBinders);
@@ -247,7 +247,7 @@ namespace ILRuntime.Runtime.Generated
                     string commonCode = i.GenerateCommonCode(realClsName);
                     ConstructorInfo[] ctors = info.Value.Constructors.ToArray();
                     string ctorRegisterCode = i.GenerateConstructorRegisterCode(ctors, excludeMethods);
-                    string methodWraperCode = i.GenerateMethodWraperCode(methods, realClsName, excludeMethods, valueTypeBinders);
+                    string methodWraperCode = i.GenerateMethodWraperCode(methods, realClsName, excludeMethods, valueTypeBinders, domain);
                     string fieldWraperCode = fields.Length > 0 ? i.GenerateFieldWraperCode(fields, realClsName, excludeFields) : null;
                     string cloneWraperCode = null;
                     if (info.Value.ValueTypeNeeded)

+ 39 - 4
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/CLRBinding/BindingGeneratorExtensions.cs

@@ -277,7 +277,7 @@ namespace ILRuntime.Runtime.CLRBinding
             }
         }
 
-        internal static void GetReturnValueCode(this Type type, StringBuilder sb)
+        internal static void GetReturnValueCode(this Type type, StringBuilder sb, Enviorment.AppDomain domain)
         {
             if (type.IsPrimitive)
             {
@@ -355,18 +355,53 @@ namespace ILRuntime.Runtime.CLRBinding
                     isBox = "";
                 if (!type.IsSealed && type != typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance))
                 {
-                    sb.Append(@"            object obj_result_of_this_method = result_of_this_method;
+                    if(domain == null || CheckAssignableToCrossBindingAdapters(domain, type))
+                    {
+                        sb.Append(@"            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");
-                    sb.Append(isBox);
-                    sb.AppendLine(@");
+                        sb.Append(isBox);
+                        sb.AppendLine(@");
             }");
+                    }
+                    else if (typeof(CrossBindingAdaptorType).IsAssignableFrom(type))
+                    {
+                        sb.AppendLine(string.Format("            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method.ILInstance{0});", isBox));
+                        return;
+                    }
+                    
                 }
                 sb.AppendLine(string.Format("            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method{0});", isBox));
             }
         }
 
+        static bool CheckAssignableToCrossBindingAdapters(Enviorment.AppDomain domain, Type type)
+        {
+            if (type == typeof(object))
+                return true;
+            bool res = domain.CrossBindingAdaptors.ContainsKey(type);
+            if (!res)
+            {
+                var baseType = type.BaseType;
+                if (baseType != null && baseType != typeof(object))
+                {
+                    res = CheckAssignableToCrossBindingAdapters(domain, baseType);
+                }
+            }
+            if (!res)
+            {
+                var interfaces = type.GetInterfaces();
+                foreach(var i in interfaces)
+                {
+                    res = CheckAssignableToCrossBindingAdapters(domain, i);
+                    if (res)
+                        break;
+                }
+            }
+            return res;
+        }
+
         internal static bool HasByRefParam(this ParameterInfo[] param)
         {
             for (int j = param.Length; j > 0; j--)

+ 1 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/CLRBinding/ConstructorBindingGenerator.cs

@@ -201,7 +201,7 @@ namespace ILRuntime.Runtime.CLRBinding
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;");
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);");
 
                         if (p.ParameterType.IsValueType && !p.ParameterType.IsPrimitive && valueTypeBinders != null && valueTypeBinders.Contains(p.ParameterType))
                         {

+ 49 - 26
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/CLRBinding/MethodBindingGenerator.cs

@@ -10,6 +10,32 @@ namespace ILRuntime.Runtime.CLRBinding
 {
     static class MethodBindingGenerator
     {
+        static string GenerateParameterTypes(MethodInfo i, bool needBracket)
+        {
+            string clsName, realClsName;
+            bool isByRef;
+            var param = i.GetParameters();
+            StringBuilder sb2 = new StringBuilder();
+            if (needBracket)
+                sb2.Append("{");
+            bool first = true;
+            foreach (var j in param)
+            {
+                if (first)
+                    first = false;
+                else
+                    sb2.Append(", ");
+                sb2.Append("typeof(");
+                j.ParameterType.GetClassName(out clsName, out realClsName, out isByRef);
+                sb2.Append(realClsName);
+                sb2.Append(")");
+                if (isByRef)
+                    sb2.Append(".MakeByRefType()");
+            }
+            if (needBracket)
+                sb2.Append("}");
+            return sb2.ToString();
+        }
         internal static string GenerateMethodRegisterCode(this Type type, MethodInfo[] methods, HashSet<MethodBase> excludes, out bool needMethods)
         {
             needMethods = false;
@@ -50,6 +76,8 @@ namespace ILRuntime.Runtime.CLRBinding
                     StringBuilder sb2 = new StringBuilder();
                     sb2.Append("{");
                     bool first = true;
+                    string clsName, realClsName;
+                    bool isByRef;
                     foreach (var j in param)
                     {
                         if (first)
@@ -57,8 +85,6 @@ namespace ILRuntime.Runtime.CLRBinding
                         else
                             sb2.Append(", ");
                         sb2.Append("typeof(");
-                        string clsName, realClsName;
-                        bool isByRef;
                         j.GetClassName(out clsName, out realClsName, out isByRef);
                         sb2.Append(realClsName);
                         sb2.Append(")");
@@ -71,9 +97,22 @@ namespace ILRuntime.Runtime.CLRBinding
                     sb.Append(@"            {
                 foreach(var m in lst)
                 {
-                    if(m.GetParameters().Length == ");
-                    sb.Append(i.GetParameters().Length.ToString());
-                    sb.Append(@")
+                    if(m.MatchGenericParameters(args, ");
+                    if (i.ReturnType != typeof(void))
+                    {
+                        sb.Append("typeof(");
+                        i.ReturnType.GetClassName(out clsName, out realClsName, out isByRef);
+                        sb.Append(realClsName);
+                        sb.Append(")");
+                    }
+                    else
+                        sb.Append("typeof(void)");
+                    if (i.GetParameters().Length > 0)
+                    {
+                        sb.Append(", ");
+                        sb.Append(GenerateParameterTypes(i, false));
+                    }
+                    sb.Append(@"))
                     {
                         method = m.MakeGenericMethod(args);
                         app.RegisterCLRMethodRedirection(method, ");
@@ -89,23 +128,7 @@ namespace ILRuntime.Runtime.CLRBinding
                     string clsName, realClsName;
                     bool isByRef;
                     var param = i.GetParameters();
-                    StringBuilder sb2 = new StringBuilder();
-                    sb2.Append("{");
-                    bool first = true;
-                    foreach (var j in param)
-                    {
-                        if (first)
-                            first = false;
-                        else
-                            sb2.Append(", ");
-                        sb2.Append("typeof(");
-                        j.ParameterType.GetClassName(out clsName, out realClsName, out isByRef);
-                        sb2.Append(realClsName);
-                        sb2.Append(")");
-                        if (isByRef)
-                            sb2.Append(".MakeByRefType()");
-                    }
-                    sb2.Append("}");
+                    string sb2 = GenerateParameterTypes(i, true);
                     sb.AppendLine(string.Format("            args = new Type[]{0};", sb2));
 
                     i.ReturnType.GetClassName(out clsName, out realClsName, out isByRef);
@@ -131,7 +154,7 @@ namespace ILRuntime.Runtime.CLRBinding
             return sb.ToString();
         }
     
-        internal static string GenerateMethodWraperCode(this Type type, MethodInfo[] methods, string typeClsName, HashSet<MethodBase> excludes, List<Type> valueTypeBinders)
+        internal static string GenerateMethodWraperCode(this Type type, MethodInfo[] methods, string typeClsName, HashSet<MethodBase> excludes, List<Type> valueTypeBinders, Enviorment.AppDomain domain)
         {
             StringBuilder sb = new StringBuilder();
             bool isMultiArr = type.IsArray && type.GetArrayRank() > 1;
@@ -481,7 +504,7 @@ namespace ILRuntime.Runtime.CLRBinding
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        var ___dst = ptr_of_this_method->ValueLong;");
+                        var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);");
 
                         if (pt.IsValueType && !pt.IsPrimitive && valueTypeBinders != null && valueTypeBinders.Contains(pt))
                         {
@@ -604,13 +627,13 @@ namespace ILRuntime.Runtime.CLRBinding
 
                         sb.AppendLine("            } else {");
 
-                        i.ReturnType.GetReturnValueCode(sb);
+                        i.ReturnType.GetReturnValueCode(sb, domain);
 
                         sb.AppendLine("            }");
                     }
                     else
                     {
-                        i.ReturnType.GetReturnValueCode(sb);
+                        i.ReturnType.GetReturnValueCode(sb, domain);
                     }
                 }
                 else

+ 163 - 22
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Debugger/DebugService.cs

@@ -20,6 +20,9 @@ namespace ILRuntime.Runtime.Debugger
         Runtime.Enviorment.AppDomain domain;
         Dictionary<int, LinkedList<BreakpointInfo>> activeBreakpoints = new Dictionary<int, LinkedList<BreakpointInfo>>();
         Dictionary<int, BreakpointInfo> breakpointMapping = new Dictionary<int, BreakpointInfo>();
+        Queue<KeyValuePair<int, VariableReference>> pendingReferences = new Queue<KeyValuePair<int, VariableReference>>();
+        Queue<KeyValuePair<int, VariableReference>> pendingEnuming = new Queue<KeyValuePair<int, VariableReference>>();
+        Queue<KeyValuePair<int, KeyValuePair<VariableReference, VariableReference>>> pendingIndexing = new Queue<KeyValuePair<int, KeyValuePair<VariableReference, VariableReference>>>();
         AutoResetEvent evt = new AutoResetEvent(false);
         
         public Action<string> OnBreakPoint;
@@ -130,7 +133,8 @@ namespace ILRuntime.Runtime.Debugger
                 arg--;
             if (arg->ObjectType == ObjectTypes.StackObjectReference)
             {
-                arg = arg->ValueLong;
+                var addr = *(long*)&arg->Value;
+                arg = (StackObject*)addr;
             }
             ILTypeInstance instance = arg->ObjectType != ObjectTypes.Null ? intepreter.Stack.ManagedStack[arg->Value] as ILTypeInstance : null;
             if (instance == null)
@@ -387,7 +391,7 @@ namespace ILRuntime.Runtime.Debugger
             StackFrame[] frames = intp.Stack.Frames.ToArray();
             Mono.Cecil.Cil.Instruction ins = null;
             ILMethod m;
-            StackFrameInfo[] frameInfos = new StackFrameInfo[frames.Length];
+            List<StackFrameInfo> frameInfos = new List<StackFrameInfo>();
 
             for (int j = 0; j < frames.Length; j++)
             {
@@ -408,6 +412,8 @@ namespace ILRuntime.Runtime.Debugger
                         info.EndLine = seq.EndLine - 1;
                         info.EndColumn = seq.EndColumn - 1;
                     }
+                    else
+                        continue;
                 }
                 StackFrame topFrame = f;
                 m = topFrame.Method;
@@ -459,9 +465,9 @@ namespace ILRuntime.Runtime.Debugger
                     vinfo.Expandable = GetValueExpandable(val, intp.Stack.ManagedStack);
                     info.LocalVariables[i] = vinfo;
                 }
-                frameInfos[j] = info;
+                frameInfos.Add(info);
             }
-            return frameInfos;
+            return frameInfos.ToArray();
         }
 
         internal unsafe VariableInfo[] EnumChildren(int threadHashCode, VariableReference parent)
@@ -469,6 +475,16 @@ namespace ILRuntime.Runtime.Debugger
             ILIntepreter intepreter;
             if (AppDomain.Intepreters.TryGetValue(threadHashCode, out intepreter))
             {
+#if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE)
+                if (domain.IsNotUnityMainThread())
+                {
+                    lock (pendingEnuming)
+                    {
+                        pendingEnuming.Enqueue(new KeyValuePair<int, VariableReference>(threadHashCode, parent));
+                    }
+                    return null;
+                }
+#endif
                 object obj;
                 var info = ResolveVariable(threadHashCode, parent, out obj);
                 if (obj != null)
@@ -651,6 +667,8 @@ namespace ILRuntime.Runtime.Debugger
                 {
                     if (i.GetIndexParameters().Length > 0)
                         continue;
+                    if (i.GetCustomAttributes(typeof(ObsoleteAttribute), true).Length > 0)
+                        continue;
                     var val = i.GetValue(obj, null);
                     VariableInfo info = VariableInfo.FromObject(val);
                     info.Type = VariableTypes.PropertyReference;
@@ -679,6 +697,17 @@ namespace ILRuntime.Runtime.Debugger
             res = null;
             if (AppDomain.Intepreters.TryGetValue(threadHashCode, out intepreter))
             {
+#if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE)
+                if (domain.IsNotUnityMainThread())
+                {
+                    lock (pendingIndexing)
+                    {
+                        pendingIndexing.Enqueue(new KeyValuePair<int, KeyValuePair<VariableReference, VariableReference>>(threadHashCode, new KeyValuePair<VariableReference, VariableReference>(body, idx)));
+                    }
+                    res = null;
+                    return new VariableInfo() { Type = VariableTypes.Pending };
+                }
+#endif
                 object obj;
                 var info = ResolveVariable(threadHashCode, body, out obj);
                 if (obj != null)
@@ -765,6 +794,63 @@ namespace ILRuntime.Runtime.Debugger
                 return VariableInfo.NullReferenceExeption;
         }
 
+        internal void ResolvePendingRequests()
+        {
+            lock (pendingReferences)
+            {
+                while (pendingReferences.Count > 0)
+                {
+                    VariableInfo info;
+                    var r = pendingReferences.Dequeue();
+                    try
+                    {
+                        object res;
+                        info = ResolveVariable(r.Key, r.Value, out res);
+                    }
+                    catch (Exception ex)
+                    {
+                        info = VariableInfo.GetException(ex);
+                    }
+                    server.SendSCResolveVariableResult(info);
+                }
+            }
+            lock (pendingEnuming)
+            {
+                while (pendingEnuming.Count > 0)
+                {
+                    VariableInfo[] info;
+                    var r = pendingEnuming.Dequeue();
+                    try
+                    {
+                        info = EnumChildren(r.Key, r.Value);
+                    }
+                    catch (Exception ex)
+                    {
+                        info = new VariableInfo[] { VariableInfo.GetException(ex) };
+                    }
+                    server.SendSCEnumChildrenResult(info);
+                }
+            }
+            lock (pendingIndexing)
+            {
+                while (pendingIndexing.Count > 0)
+                {
+                    VariableInfo info;
+                    var r = pendingIndexing.Dequeue();
+                    try
+                    {
+                        object res;
+                        info = ResolveIndexAccess(r.Key, r.Value.Key, r.Value.Value, out res);
+                    }
+                    catch (Exception ex)
+                    {
+                        info = VariableInfo.GetException(ex);
+                    }
+                    server.SendSCResolveVariableResult(info);
+                }
+            }
+        }
+
         internal unsafe VariableInfo ResolveVariable(int threadHashCode, VariableReference variable, out object res)
         {
             ILIntepreter intepreter;
@@ -773,6 +859,17 @@ namespace ILRuntime.Runtime.Debugger
             {
                 if (variable != null)
                 {
+#if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE)
+                    if (domain.IsNotUnityMainThread())
+                    {
+                        lock (pendingReferences)
+                        {
+                            pendingReferences.Enqueue(new KeyValuePair<int, VariableReference>(threadHashCode, variable));
+                        }
+                        res = null;
+                        return new VariableInfo() { Type = VariableTypes.Pending };
+                    }
+#endif
                     switch (variable.Type)
                     {
                         case VariableTypes.Normal:
@@ -814,7 +911,26 @@ namespace ILRuntime.Runtime.Debugger
                                     {
                                         var addr = Minus(frame.LocalVarPointer, m.ParameterCount + 1);
                                         var v = StackObject.ToObject(addr, intepreter.AppDomain, intepreter.Stack.ManagedStack);
-                                        return ResolveMember(v, variable.Name, out res);
+                                        var result = ResolveMember(v, variable.Name, out res);
+                                        if (result.Type == VariableTypes.NotFound)
+                                        {
+                                            ILTypeInstance ins = v as ILTypeInstance;
+                                            if (ins != null)
+                                            {
+                                                var ilType = ins.Type.ReflectionType;
+                                                var fields = ilType.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+                                                foreach (var f in fields)
+                                                {
+                                                    if (f.Name.Contains("_this"))
+                                                    {
+                                                        result = ResolveMember(f.GetValue(v), variable.Name, out res);
+                                                        if (result.Type != VariableTypes.NotFound)
+                                                            return result;
+                                                    }
+                                                }
+                                            }
+                                        }
+                                        return result;
                                     }
                                     else
                                     {
@@ -897,22 +1013,44 @@ namespace ILRuntime.Runtime.Debugger
             }
             else
             {
-                var pi = type.GetProperty(name, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
-                if (pi != null)
+                var fields = type.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+                string match = string.Format("<{0}>", name);
+                foreach (var f in fields)
                 {
-                    res = pi.GetValue(obj, null);
-                    VariableInfo info = VariableInfo.FromObject(res);
+                    if (f.Name.Contains(match))
+                    {
+                        res = f.GetValue(obj);
+                        VariableInfo info = VariableInfo.FromObject(res);
 
-                    info.Address = 0;
-                    info.Name = name;
-                    info.Type = VariableTypes.PropertyReference;
-                    info.TypeName = pi.PropertyType.FullName;
-                    info.IsPrivate = pi.GetGetMethod(true).IsPrivate;
-                    info.IsProtected = pi.GetGetMethod(true).IsFamily;
-                    info.Expandable = res != null && !pi.PropertyType.IsPrimitive;
-                    return info;
+                        info.Address = 0;
+                        info.Name = name;
+                        info.Type = VariableTypes.FieldReference;
+                        info.TypeName = f.FieldType.FullName;
+                        info.IsPrivate = f.IsPrivate;
+                        info.IsProtected = f.IsFamily;
+                        info.Expandable = res != null && !f.FieldType.IsPrimitive;
+
+                        return info;
+                    }
                 }
             }
+
+            var pi = type.GetProperty(name, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+            if (pi != null)
+            {
+                res = pi.GetValue(obj, null);
+                VariableInfo info = VariableInfo.FromObject(res);
+
+                info.Address = 0;
+                info.Name = name;
+                info.Type = VariableTypes.PropertyReference;
+                info.TypeName = pi.PropertyType.FullName;
+                info.IsPrivate = pi.GetGetMethod(true).IsPrivate;
+                info.IsProtected = pi.GetGetMethod(true).IsFamily;
+                info.Expandable = res != null && !pi.PropertyType.IsPrimitive;
+                return info;
+            }
+
             return VariableInfo.GetCannotFind(name);
         }
 
@@ -955,6 +1093,9 @@ namespace ILRuntime.Runtime.Debugger
         {
             activeBreakpoints.Clear();
             breakpointMapping.Clear();
+            pendingEnuming.Clear();
+            pendingReferences.Clear();
+            pendingIndexing.Clear();
             foreach (var j in AppDomain.Intepreters)
             {
                 j.Value.ClearDebugState();
@@ -1004,7 +1145,7 @@ namespace ILRuntime.Runtime.Debugger
                 if (i < esp)
                 {
                     if (i->ObjectType == ObjectTypes.ValueTypeObjectReference)
-                        VisitValueTypeReference(i->ValueLong, leakVObj);
+                        VisitValueTypeReference(ILIntepreter.ResolveReference(i), leakVObj);
                 }
                 if (isLocal)
                 {
@@ -1061,13 +1202,13 @@ namespace ILRuntime.Runtime.Debugger
             {
                 case ObjectTypes.StackObjectReference:
                     {
-                        sb.Append(string.Format("Value:0x{0:X8}", (long)esp->ValueLong));
+                        sb.Append(string.Format("Value:0x{0:X8}", (long)ILIntepreter.ResolveReference(esp)));
                     }
                     break;
                 case ObjectTypes.ValueTypeObjectReference:
                     {
                         object obj = null;
-                        var dst = esp->ValueLong;
+                        var dst = ILIntepreter.ResolveReference(esp);
                         if (dst > valueTypeEnd)
                             obj = StackObject.ToObject(esp, domain, mStack);
                         if (obj != null)
@@ -1075,7 +1216,7 @@ namespace ILRuntime.Runtime.Debugger
 
                         text += string.Format("({0})", domain.GetType(dst->Value));
                     }
-                    sb.Append(string.Format("Value:0x{0:X8} Text:{1} ", (long)esp->ValueLong, text));
+                    sb.Append(string.Format("Value:0x{0:X8} Text:{1} ", (long)ILIntepreter.ResolveReference(esp), text));
                     break;
                 default:
                     {
@@ -1104,7 +1245,7 @@ namespace ILRuntime.Runtime.Debugger
                 var ptr = Minus(esp, i + 1);
                 if (ptr->ObjectType == ObjectTypes.ValueTypeObjectReference)
                 {
-                    VisitValueTypeReference(ptr->ValueLong, leak);
+                    VisitValueTypeReference(ILIntepreter.ResolveReference(ptr), leak);
                 }
             }
         }

+ 67 - 16
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Debugger/DebuggerServer/DebuggerServer.cs

@@ -174,7 +174,8 @@ namespace ILRuntime.Runtime.Debugger
                         {
                             info = VariableInfo.GetException(ex);
                         }
-                        SendSCResolveVariableResult(info);
+                        if (info.Type != VariableTypes.Pending)
+                            SendSCResolveVariableResult(info);
                     }
                     break;
                 case DebugMessageType.CSResolveIndexAccess:
@@ -194,7 +195,8 @@ namespace ILRuntime.Runtime.Debugger
                         {
                             info = VariableInfo.GetException(ex);
                         }
-                        SendSCResolveVariableResult(info);
+                        if (info.Type != VariableTypes.Pending)
+                            SendSCResolveVariableResult(info);
                     }
                     break;
                 case DebugMessageType.CSEnumChildren:
@@ -211,7 +213,8 @@ namespace ILRuntime.Runtime.Debugger
                         {
                             info = new VariableInfo[] { VariableInfo.GetException(ex) };
                         }
-                        SendSCEnumChildrenResult(info);
+                        if (info != null)
+                            SendSCEnumChildrenResult(info);
                     }
                     break;
             }
@@ -260,6 +263,40 @@ namespace ILRuntime.Runtime.Debugger
                 clientSocket.Send(type, sendStream.GetBuffer(), (int)sendStream.Position);
         }
 
+        bool CheckCompilerGeneratedStateMachine(ILMethod ilm, Enviorment.AppDomain domain,int startLine, out ILMethod found)
+        {
+            var mDef = ilm.Definition;
+            Mono.Cecil.CustomAttribute ca = null;
+            found = null;
+            foreach (var attr in mDef.CustomAttributes)
+            {
+                switch (attr.AttributeType.FullName)
+                {
+                    case "System.Runtime.CompilerServices.AsyncStateMachineAttribute":
+                    case "System.Runtime.CompilerServices.IteratorStateMachineAttribute":
+                        ca = attr;
+                        break;
+
+                }
+            }
+            if (ca != null)
+            {
+                if (ca.ConstructorArguments.Count > 0)
+                {
+                    var smType = domain.GetType(ca.ConstructorArguments[0].Value, null, null);
+                    if (smType != null)
+                    {
+                        ilm = smType.GetMethod("MoveNext", 0, true) as ILMethod;
+                        if (ilm != null && ilm.StartLine <= (startLine + 1) && ilm.EndLine >= (startLine + 1))
+                        {
+                            found = ilm;
+                            return true;
+                        }
+                    }
+                }
+            }
+            return false;
+        }
         void TryBindBreakpoint(CSBindBreakpoint msg)
         {
             var domain = ds.AppDomain;
@@ -286,6 +323,10 @@ namespace ILRuntime.Runtime.Debugger
                                         found = ilm;
                                         break;
                                     }
+                                    else if (CheckCompilerGeneratedStateMachine(ilm, domain, msg.StartLine, out found))
+                                    {
+                                        break;
+                                    }
                                 }
                             }
                         }
@@ -343,6 +384,10 @@ namespace ILRuntime.Runtime.Debugger
                                         found = ilm;
                                         break;
                                     }
+                                    else if(CheckCompilerGeneratedStateMachine(ilm, domain, msg.StartLine, out found))
+                                    {
+                                        break;
+                                    }
                                 }
                             }
                         }
@@ -394,27 +439,33 @@ namespace ILRuntime.Runtime.Debugger
             DoSend(DebugMessageType.SCStepComplete);
         }
 
-        void SendSCResolveVariableResult(VariableInfo info)
+        internal void SendSCResolveVariableResult(VariableInfo info)
         {
-            sendStream.Position = 0;
-            WriteVariableInfo(info);
-            DoSend(DebugMessageType.SCResolveVariableResult);
+            lock (this)
+            {
+                sendStream.Position = 0;
+                WriteVariableInfo(info);
+                DoSend(DebugMessageType.SCResolveVariableResult);
+            }
         }
 
-        void SendSCEnumChildrenResult(VariableInfo[] info)
+        internal void SendSCEnumChildrenResult(VariableInfo[] info)
         {
-            sendStream.Position = 0;
-            if (info != null)
+            lock (this)
             {
-                bw.Write(info.Length);
-                for (int i = 0; i < info.Length; i++)
+                sendStream.Position = 0;
+                if (info != null)
                 {
-                    WriteVariableInfo(info[i]);
+                    bw.Write(info.Length);
+                    for (int i = 0; i < info.Length; i++)
+                    {
+                        WriteVariableInfo(info[i]);
+                    }
                 }
+                else
+                    bw.Write(0);
+                DoSend(DebugMessageType.SCEnumChildrenResult);
             }
-            else
-                bw.Write(0);
-            DoSend(DebugMessageType.SCEnumChildrenResult);
         }
 
         void WriteStackFrames(KeyValuePair<int, StackFrameInfo[]>[] info)

+ 1 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Debugger/VariableInfo.cs

@@ -20,6 +20,7 @@ namespace ILRuntime.Runtime.Debugger
         Error,
         NotFound,
         Timeout,
+        Pending,
     }
 
     public enum ValueTypes

+ 34 - 7
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/AppDomain.cs

@@ -60,6 +60,10 @@ namespace ILRuntime.Runtime.Enviorment
 
 #if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE)
         public int UnityMainThreadID { get; set; }
+        public bool IsNotUnityMainThread()
+        {
+            return UnityMainThreadID != 0 && (UnityMainThreadID != System.Threading.Thread.CurrentThread.ManagedThreadId);
+        }
 #endif
         public unsafe AppDomain()
         {
@@ -138,6 +142,10 @@ namespace ILRuntime.Runtime.Enviorment
                 {
                     RegisterCLRMethodRedirection(i, CLRRedirections.EnumGetName);
                 }
+                if (i.Name == "ToObject" && i.GetParameters()[1].ParameterType == typeof(int))
+                {
+                    RegisterCLRMethodRedirection(i, CLRRedirections.EnumToObject);
+                }
             }
             mi = typeof(System.Type).GetMethod("GetTypeFromHandle");
             RegisterCLRMethodRedirection(mi, CLRRedirections.GetTypeFromHandle);
@@ -538,6 +546,8 @@ namespace ILRuntime.Runtime.Enviorment
                     mapTypeToken[bt.GetHashCode()] = bt;
                     if (bt is CLRType)
                     {
+                        clrTypeMapping[bt.TypeForCLR] = bt;
+
                         //It still make sense for CLRType, since CLR uses [T] for generics instead of <T>
                         StringBuilder sb = new StringBuilder();
                         sb.Append(baseType);
@@ -546,9 +556,9 @@ namespace ILRuntime.Runtime.Enviorment
                         {
                             if (i > 0)
                                 sb.Append(",");
-                            if (genericParams[i].Contains(","))
+                            /*if (genericParams[i].Contains(","))
                                 sb.Append(genericParams[i].Substring(0, genericParams[i].IndexOf(',')));
-                            else
+                            else*/
                                 sb.Append(genericParams[i]);
                         }
                         sb.Append('>');
@@ -561,6 +571,8 @@ namespace ILRuntime.Runtime.Enviorment
                 if (isArray)
                 {
                     bt = bt.MakeArrayType(1);
+                    if (bt is CLRType)
+                        clrTypeMapping[bt.TypeForCLR] = bt;
                     mapType[bt.FullName] = bt;
                     mapTypeToken[bt.GetHashCode()] = bt;
                     if (!isByRef)
@@ -573,6 +585,8 @@ namespace ILRuntime.Runtime.Enviorment
                 if (isByRef)
                 {
                     res = bt.MakeByRefType();
+                    if (bt is CLRType)
+                        clrTypeMapping[bt.TypeForCLR] = bt;
                     mapType[fullname] = res;
                     mapType[res.FullName] = res;
                     mapTypeToken[res.GetHashCode()] = res;
@@ -652,7 +666,7 @@ namespace ILRuntime.Runtime.Enviorment
                                 name = name.Substring(1, name.Length - 2);
                             if (!string.IsNullOrEmpty(name))
                                 genericParams.Add(name);
-                            else
+                            else if (!string.IsNullOrEmpty(name))
                             {
                                 if (!isArray)
                                 {
@@ -663,6 +677,11 @@ namespace ILRuntime.Runtime.Enviorment
                                     baseType += "[]";
                                 }
                             }
+                            else
+                            {
+                                sb.Append("<>");
+                                continue;
+                            }
                             sb.Length = 0;
                             continue;
                         }
@@ -722,7 +741,7 @@ namespace ILRuntime.Runtime.Enviorment
                 if (_ref.IsByReference)
                 {
                     var et = _ref.GetElementType();
-                    bool valid = !et.IsGenericParameter;
+                    bool valid = !et.ContainsGenericParameter;
                     var t = GetType(et, contextType, contextMethod);
                     if (t != null)
                     {
@@ -733,9 +752,11 @@ namespace ILRuntime.Runtime.Enviorment
                             ((ILType)res).TypeReference = _ref;
                         }
                         if (valid)
+                        {
                             mapTypeToken[hash] = res;
-                        if (!string.IsNullOrEmpty(res.FullName))
-                            mapType[res.FullName] = res;
+                            if (!string.IsNullOrEmpty(res.FullName))
+                                mapType[res.FullName] = res;
+                        }
                         return res;
                     }
                     return null;
@@ -756,6 +777,10 @@ namespace ILRuntime.Runtime.Enviorment
                             }
                             mapTypeToken[hash] = res;
                         }
+                        else
+                        {
+                            mapTypeToken[res.GetHashCode()] = res;
+                        }
                         if (!string.IsNullOrEmpty(res.FullName))
                             mapType[res.FullName] = res;
                         return res;
@@ -790,12 +815,14 @@ namespace ILRuntime.Runtime.Enviorment
                         }
                         else
                             val = GetType(gType.GenericArguments[i], contextType, contextMethod);
-                        if (val != null && gType.GenericArguments[i].ContainsGenericParameter)
+                        if (gType.GenericArguments[i].ContainsGenericParameter)
                             dummyGenericInstance = true;
                         if (val != null)
                             genericArguments[i] = new KeyValuePair<string, IType>(key, val);
                         else
                         {
+                            if (!dummyGenericInstance)
+                                return null;
                             genericArguments = null;
                             break;
                         }

+ 62 - 2
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/CLRRedirections.cs

@@ -966,6 +966,21 @@ namespace ILRuntime.Runtime.Enviorment
 
                                 return ILIntepreter.PushObject(ret, mStack, ins, true);
                             }
+                            else
+                            {
+                                int val;
+                                if(int.TryParse(name, out val))
+                                {
+                                    if((int)f.Constant == val)
+                                    {
+                                        ILEnumTypeInstance ins = new ILEnumTypeInstance(it);
+                                        ins[0] = f.Constant;
+                                        ins.Boxed = true;
+
+                                        return ILIntepreter.PushObject(ret, mStack, ins, true);
+                                    }
+                                }
+                            }
                         }
                     }
                     return ILIntepreter.PushNull(ret);
@@ -1025,7 +1040,6 @@ namespace ILRuntime.Runtime.Enviorment
         {
             var ret = esp - 1;
             AppDomain domain = intp.AppDomain;
-
             var p = esp - 1;
             Type t = (Type)StackObject.ToObject(p, domain, mStack);
             intp.Free(p);
@@ -1077,7 +1091,53 @@ namespace ILRuntime.Runtime.Enviorment
                 List<string> res = new List<string>();
                 if (it.IsEnum)
                 {
-                    ILEnumTypeInstance ins = (ILEnumTypeInstance)val;
+                    if (val is ILEnumTypeInstance)
+                    {
+                        ILEnumTypeInstance ins = (ILEnumTypeInstance)val;
+                        return ILIntepreter.PushObject(ret, mStack, ins.ToString(), true);
+                    }
+                    else if (val.GetType().IsPrimitive)
+                    {
+                        ILEnumTypeInstance ins = new ILEnumTypeInstance(it);
+                        ins[0] = val;
+                        return ILIntepreter.PushObject(ret, mStack, ins.ToString(), true);
+                    }
+                    else
+                        throw new NotImplementedException();
+                }
+                else
+                    throw new Exception(string.Format("{0} is not Enum", t.FullName));
+            }
+            else if (t is ILRuntimeWrapperType)
+            {
+                return ILIntepreter.PushObject(ret, mStack, Enum.GetName(((ILRuntimeWrapperType)t).RealType, val), true);
+            }
+            else
+                return ILIntepreter.PushObject(ret, mStack, Enum.GetName(t, val), true);
+        }
+
+        public static StackObject* EnumToObject(ILIntepreter intp, StackObject* esp, IList<object> mStack, CLRMethod method, bool isNewObj)
+        {
+            var ret = esp - 1 - 1;
+            AppDomain domain = intp.AppDomain;
+
+            var p = esp - 1;
+            int val = p->Value;
+            intp.Free(p);
+
+            p = esp - 1 - 1;
+            Type t = (Type)StackObject.ToObject(p, domain, mStack);
+            intp.Free(p);
+
+            if (t is ILRuntimeType)
+            {
+                ILType it = ((ILRuntimeType)t).ILType;
+
+                List<string> res = new List<string>();
+                if (it.IsEnum)
+                {
+                    ILEnumTypeInstance ins = new ILEnumTypeInstance(it);
+                    ins[0] = val;
                     return ILIntepreter.PushObject(ret, mStack, ins.ToString(), true);
                 }
                 else

+ 9 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/CrossBindingAdaptor.cs

@@ -188,6 +188,15 @@ namespace ILRuntime.Runtime.Enviorment
             }
         }
 
+
+        public bool IsEnum
+        {
+            get
+            {
+                return type.IsEnum;
+            }
+        }
+
         public bool IsDelegate
         {
             get

+ 5 - 5
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Enviorment/ValueTypeBinder.cs

@@ -46,7 +46,7 @@ namespace ILRuntime.Runtime.Enviorment
             {
                 case ObjectTypes.ValueTypeObjectReference:
                     {
-                        var dst = esp->ValueLong;
+                        var dst = ILIntepreter.ResolveReference(esp);
                         var vb = ((CLRType)domain.GetType(dst->Value)).ValueTypeBinder as ValueTypeBinder<K>;
                         if (vb != null)
                         {
@@ -76,7 +76,7 @@ namespace ILRuntime.Runtime.Enviorment
                     break;
                 case ObjectTypes.ValueTypeObjectReference:
                     {
-                        var dst = esp->ValueLong;
+                        var dst = ILIntepreter.ResolveReference(esp);
                         var vb = ((CLRType)domain.GetType(dst->Value)).ValueTypeBinder as ValueTypeBinder<K>;
                         if (vb != null)
                         {
@@ -117,7 +117,7 @@ namespace ILRuntime.Runtime.Enviorment
             var a = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
             if (a->ObjectType == ObjectTypes.ValueTypeObjectReference)
             {
-                var ptr = a->ValueLong;
+                var ptr = ILIntepreter.ResolveReference(a);
                 AssignFromStack(ref value, ptr, mStack);
                 if (shouldFree)
                     intp.FreeStackValueType(ptr_of_this_method);
@@ -175,7 +175,7 @@ namespace ILRuntime.Runtime.Enviorment
                     break;
                 case ObjectTypes.ValueTypeObjectReference:
                     {
-                        var dst = ptr_of_this_method->ValueLong;
+                        var dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                         CopyValueTypeToStack(ref instance_of_this_method, dst, mStack);
                     }
                     break;
@@ -185,7 +185,7 @@ namespace ILRuntime.Runtime.Enviorment
         public void PushValue(ref T value, ILIntepreter intp, StackObject* ptr_of_this_method, IList<object> mStack)
         {
             intp.AllocValueType(ptr_of_this_method, clrType);
-            var dst = ptr_of_this_method->ValueLong;
+            var dst = ILIntepreter.ResolveReference(ptr_of_this_method);
             CopyValueTypeToStack(ref value, dst, mStack);
         }
     }

+ 90 - 1
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Extensions.cs

@@ -7,7 +7,7 @@ using ILRuntime.Runtime.Stack;
 
 namespace ILRuntime.Runtime
 {
-    static class Extensions
+    public static class Extensions
     {
         public static void GetClassName(this Type type, out string clsName, out string realClsName, out bool isByRef, bool simpleClassName = false)
         {
@@ -266,5 +266,94 @@ namespace ILRuntime.Runtime
             else
                 return value.GetType();
         }
+
+        public static bool MatchGenericParameters(this System.Reflection.MethodInfo m, Type[] genericArguments, Type returnType, params Type[] parameters)
+        {
+            var param = m.GetParameters();
+            if (param.Length == parameters.Length)
+            {
+                var args = m.GetGenericArguments();
+                if (args.MatchGenericParameters(m.ReturnType, returnType, genericArguments))
+                {
+                    for (int i = 0; i < param.Length; i++)
+                    {
+                        if (!args.MatchGenericParameters(param[i].ParameterType, parameters[i], genericArguments))
+                            return false;
+                    }
+
+                    return true;
+                }
+                else
+                    return false;
+            }
+            else
+                return false;
+        }
+
+        public static bool MatchGenericParameters(this Type[] args, Type type, Type q, Type[] genericArguments)
+        {
+            if (type.IsGenericParameter)
+            {
+                for (int i = 0; i < args.Length; i++)
+                {
+                    if (args[i] == type)
+                    {
+                        return q == genericArguments[i];
+                    }
+                }
+                throw new NotSupportedException();
+            }
+            else
+            {
+                if (type.IsArray)
+                {
+                    if (q.IsArray)
+                    {
+                        return MatchGenericParameters(args, type.GetElementType(), q.GetElementType(), genericArguments);
+                    }
+                    else
+                        return false;
+                }
+                else if (type.IsByRef)
+                {
+                    if (q.IsByRef)
+                    {
+                        return MatchGenericParameters(args, type.GetElementType(), q.GetElementType(), genericArguments);
+                    }
+                    else
+                        return false;
+                }
+                else if (type.IsGenericType)
+                {
+                    if (q.IsGenericType)
+                    {
+                        var t1 = type.GetGenericTypeDefinition();
+                        var t2 = type.GetGenericTypeDefinition();
+                        if (t1 == t2)
+                        {
+                            var argA = type.GetGenericArguments();
+                            var argB = q.GetGenericArguments();
+                            if (argA.Length == argB.Length)
+                            {
+                                for (int i = 0; i < argA.Length; i++)
+                                {
+                                    if (!MatchGenericParameters(args, argA[i], argB[i], genericArguments))
+                                        return false;
+                                }
+                                return true;
+                            }
+                            else
+                                return false;
+                        }
+                        else
+                            return false;
+                    }
+                    else
+                        return false;
+                }
+                else
+                    return type == q;
+            }
+        }
     }
 }

+ 10 - 0
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/DelegateAdapter.cs

@@ -1008,6 +1008,16 @@ namespace ILRuntime.Runtime.Intepreter
                 return false;
         }
 
+        public override bool Equals(object obj)
+        {
+            if (obj is DelegateAdapter)
+            {
+                DelegateAdapter b = (DelegateAdapter)obj;
+                return instance == b.instance && method == b.method;
+            }
+            return false;
+        }
+
         public virtual bool Equals(Delegate dele)
         {
             return Delegate == dele;

Fișier diff suprimat deoarece este prea mare
+ 173 - 154
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/ILIntepreter.cs


+ 3 - 3
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Intepreter/ILTypeInstance.cs

@@ -406,7 +406,7 @@ namespace ILRuntime.Runtime.Intepreter
                     case ObjectTypes.ValueTypeObjectReference:
                         {
                             var obj = managedObjs[i];
-                            var dst = val->ValueLong;
+                            var dst = ILIntepreter.ResolveReference(val);
                             var vt = type.AppDomain.GetType(dst->Value);
                             if (vt is ILType)
                             {
@@ -449,7 +449,7 @@ namespace ILRuntime.Runtime.Intepreter
 
         internal unsafe void AssignFromStack(StackObject* esp, Enviorment.AppDomain appdomain, IList<object> managedStack)
         {
-            StackObject* val = esp->ValueLong;
+            StackObject* val = ILIntepreter.ResolveReference(esp);
             int cnt = val->ValueLow;
             for (int i = 0; i < cnt; i++)
             {
@@ -475,7 +475,7 @@ namespace ILRuntime.Runtime.Intepreter
                         var domain = type.AppDomain;
                         field.ObjectType = ObjectTypes.Object;
                         field.Value = fieldIdx;
-                        var dst = esp->ValueLong;
+                        var dst = ILIntepreter.ResolveReference(esp);
                         var vt = domain.GetType(dst->Value);
                         if(vt is ILType)
                         {

+ 14 - 14
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Stack/RuntimeStack.cs

@@ -126,7 +126,7 @@ namespace ILRuntime.Runtime.Stack
                 {
                     StackObject* oriAddr = frame.ValueTypeBasePointer;
                     RelocateValueType(ret, ref frame.ValueTypeBasePointer, ref mStackBase);
-                    ret->ValueLong = oriAddr;
+                    *(long*)&ret->Value = (long)oriAddr;
                 }
                 ret++;
             }
@@ -141,7 +141,7 @@ namespace ILRuntime.Runtime.Stack
 
         void RelocateValueType(StackObject* src, ref StackObject* dst, ref int mStackBase)
         {
-            StackObject* descriptor = src->ValueLong;
+            StackObject* descriptor = ILIntepreter.ResolveReference(src);
             if (descriptor > dst)
                 throw new StackOverflowException();
             *dst = *descriptor;
@@ -168,7 +168,7 @@ namespace ILRuntime.Runtime.Stack
                     case ObjectTypes.ValueTypeObjectReference:
                         var newAddr = endAddr;
                         RelocateValueType(addr, ref endAddr, ref mStackBase);
-                        tarVal->ValueLong = newAddr;
+                        *(long*)&tarVal->Value = (long)newAddr;
                         break;
                 }
             }
@@ -190,7 +190,7 @@ namespace ILRuntime.Runtime.Stack
                 }
                 ptr->ObjectType = ObjectTypes.ValueTypeObjectReference;
                 var dst = valueTypePtr;
-                ptr->ValueLong = dst;
+                *(long*)&ptr->Value = (long)dst;
                 dst->ObjectType = ObjectTypes.ValueTypeDescriptor;
                 dst->Value = type.GetHashCode();
                 dst->ValueLow = fieldCount;
@@ -212,7 +212,7 @@ namespace ILRuntime.Runtime.Stack
                 {
                     var ft = t.FieldTypes[i];
                     StackObject* val = ILIntepreter.Minus(ptr, t.FieldStartIndex + i + 1);
-                    if (ft.IsPrimitive)
+                    if (ft.IsPrimitive || ft.IsEnum)
                         StackObject.Initialized(val, ft);
                     else
                     {
@@ -281,14 +281,14 @@ namespace ILRuntime.Runtime.Stack
                 {
                     var ft = t.FieldTypes[i];
                     StackObject* val = ILIntepreter.Minus(ptr, t.FieldStartIndex + i + 1);
-                    if (ft.IsPrimitive)
+                    if (ft.IsPrimitive || ft.IsEnum)
                         StackObject.Initialized(val, ft);
                     else
                     {
                         switch (val->ObjectType)
                         {
                             case ObjectTypes.ValueTypeObjectReference:
-                                ClearValueTypeObject(ft, val->ValueLong);
+                                ClearValueTypeObject(ft, ILIntepreter.ResolveReference(val));
                                 break;
                             default:
                                 if (ft.IsValueType)
@@ -327,7 +327,7 @@ namespace ILRuntime.Runtime.Stack
                         {
                             case ObjectTypes.ValueTypeObjectReference:
                                 {
-                                    var dst = val->ValueLong;
+                                    var dst = ILIntepreter.ResolveReference(val);
                                     ClearValueTypeObject(vt, dst);
                                 }
                                 break;
@@ -352,10 +352,10 @@ namespace ILRuntime.Runtime.Stack
             int start = int.MaxValue;
             int end = int.MinValue;
             StackObject* endAddr;
-            CountValueTypeManaged(esp, ref start, ref end, out endAddr);
+            CountValueTypeManaged(esp, ref start, ref end, &endAddr);
 
             if (endAddr == valueTypePtr)
-                valueTypePtr = esp->ValueLong;
+                valueTypePtr = ILIntepreter.ResolveReference(esp);
             else
                 throw new NotSupportedException();
             if (start != int.MaxValue)
@@ -373,11 +373,11 @@ namespace ILRuntime.Runtime.Stack
             }
         }
 
-        void CountValueTypeManaged(StackObject* esp, ref int start, ref int end, out StackObject* endAddr)
+        void CountValueTypeManaged(StackObject* esp, ref int start, ref int end, StackObject** endAddr)
         {
-            StackObject* descriptor = esp->ValueLong;
+            StackObject* descriptor = ILIntepreter.ResolveReference(esp);
             int cnt = descriptor->ValueLow;
-            endAddr = ILIntepreter.Minus(descriptor, cnt + 1);
+            *endAddr = ILIntepreter.Minus(descriptor, cnt + 1);
             for (int i = 0; i < cnt; i++)
             {
                 StackObject* addr = ILIntepreter.Minus(descriptor, i + 1);
@@ -399,7 +399,7 @@ namespace ILRuntime.Runtime.Stack
                         }
                         break;
                     case ObjectTypes.ValueTypeObjectReference:
-                        CountValueTypeManaged(addr, ref start, ref end, out endAddr);
+                        CountValueTypeManaged(addr, ref start, ref end, endAddr);
                         break;
                 }
 

+ 3 - 23
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Stack/StackObject.cs

@@ -16,26 +16,6 @@ namespace ILRuntime.Runtime.Stack
         public int Value;
         public int ValueLow;
 
-        public unsafe StackObject* ValueLong
-        {
-            get
-            {
-                fixed (int* i = &this.Value)
-                {
-                    ulong* p = (ulong*) i;
-                    return (StackObject*) (*p);
-                }
-            }
-            set
-            {
-                fixed (int* i = &this.Value)
-                {
-                    ulong* p = (ulong*) i;
-                    *p = (ulong)value;
-                }
-            }
-        }
-
         public static bool operator ==(StackObject a, StackObject b)
         {
             return (a.ObjectType == b.ObjectType) && (a.Value == b.Value) && (a.ValueLow == b.ValueLow);
@@ -109,11 +89,11 @@ namespace ILRuntime.Runtime.Stack
                     }
                 case ObjectTypes.StackObjectReference:
                     {
-                        return ToObject(esp->ValueLong, appdomain, mStack);
+                        return ToObject((ILIntepreter.ResolveReference(esp)), appdomain, mStack);
                     }
                 case ObjectTypes.ValueTypeObjectReference:
                     {
-                        StackObject* dst = esp->ValueLong;
+                        StackObject* dst = ILIntepreter.ResolveReference(esp);
                         IType type = appdomain.GetType(dst->Value);
                         if (type is ILType)
                         {
@@ -209,7 +189,7 @@ namespace ILRuntime.Runtime.Stack
         public unsafe static void Initialized(StackObject* esp, IType type)
         {
             var t = type.TypeForCLR;
-            if (type.IsPrimitive)
+            if (type.IsPrimitive || type.IsEnum)
             {
                 if (t == typeof(int) || t == typeof(uint) || t == typeof(short) || t == typeof(ushort) || t == typeof(byte) || t == typeof(sbyte) || t == typeof(char) || t == typeof(bool))
                 {

+ 1 - 2
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.20.meta

@@ -1,9 +1,8 @@
 fileFormatVersion: 2
 guid: 3fc7b998c1246164aac5aa55cf027d33
 folderAsset: yes
-timeCreated: 1486603934
-licenseType: Pro
 DefaultImporter:
+  externalObjects: {}
   userData: 
   assetBundleName: 
   assetBundleVariant: 

+ 1 - 2
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb.meta

@@ -1,9 +1,8 @@
 fileFormatVersion: 2
 guid: 11660fbe11a364e4a96be8477921d6f9
 folderAsset: yes
-timeCreated: 1486603934
-licenseType: Pro
 DefaultImporter:
+  externalObjects: {}
   userData: 
   assetBundleName: 
   assetBundleVariant: 

+ 2 - 3
Unity/Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb/pdb/Mono.Cecil.Pdb/PdbReader.cs

@@ -93,9 +93,8 @@ namespace Mono.Cecil.Pdb
                 Guid guid;
                 var funcs = PdbFile.LoadFunctions(pdb_file, true, out age, out guid);
 
-                // 11111111111111111111111 这里做了点修改
-                //if (this.age != 0 && this.guid != guid)
-                //    return false;
+                if (this.age != 0 && this.guid != guid)
+                    return false;
 
                 foreach (PdbFunction function in funcs)
                     functions.Add(function.token, function);

+ 1 - 0
Unity/Unity.Model.csproj

@@ -167,6 +167,7 @@
     <Compile Include="Assets\Model\ILBinding\ETModel_ComponentFactory_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_ComponentView_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_ConfigAttribute_Binding.cs" />
+    <Compile Include="Assets\Model\ILBinding\ETModel_Define_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_DoubleMap_2_UInt16_Type_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_Entity_Binding.cs" />
     <Compile Include="Assets\Model\ILBinding\ETModel_ErrorCode_Binding.cs" />

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff