ETModel_GameObjectHelper_Binding.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Runtime.InteropServices;
  6. using ILRuntime.CLR.TypeSystem;
  7. using ILRuntime.CLR.Method;
  8. using ILRuntime.Runtime.Enviorment;
  9. using ILRuntime.Runtime.Intepreter;
  10. using ILRuntime.Runtime.Stack;
  11. using ILRuntime.Reflection;
  12. using ILRuntime.CLR.Utils;
  13. namespace ILRuntime.Runtime.Generated
  14. {
  15. unsafe class ETModel_GameObjectHelper_Binding
  16. {
  17. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  18. {
  19. MethodBase method;
  20. Type[] args;
  21. Type type = typeof(ETModel.GameObjectHelper);
  22. Dictionary<string, List<MethodInfo>> genericMethods = new Dictionary<string, List<MethodInfo>>();
  23. List<MethodInfo> lst = null;
  24. foreach(var m in type.GetMethods())
  25. {
  26. if(m.IsGenericMethodDefinition)
  27. {
  28. if (!genericMethods.TryGetValue(m.Name, out lst))
  29. {
  30. lst = new List<MethodInfo>();
  31. genericMethods[m.Name] = lst;
  32. }
  33. lst.Add(m);
  34. }
  35. }
  36. args = new Type[]{typeof(UnityEngine.TextAsset)};
  37. if (genericMethods.TryGetValue("Get", out lst))
  38. {
  39. foreach(var m in lst)
  40. {
  41. if(m.GetParameters().Length == 2)
  42. {
  43. method = m.MakeGenericMethod(args);
  44. app.RegisterCLRMethodRedirection(method, Get_0);
  45. break;
  46. }
  47. }
  48. }
  49. args = new Type[]{typeof(UnityEngine.GameObject)};
  50. if (genericMethods.TryGetValue("Get", out lst))
  51. {
  52. foreach(var m in lst)
  53. {
  54. if(m.GetParameters().Length == 2)
  55. {
  56. method = m.MakeGenericMethod(args);
  57. app.RegisterCLRMethodRedirection(method, Get_1);
  58. break;
  59. }
  60. }
  61. }
  62. }
  63. static StackObject* Get_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  64. {
  65. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  66. StackObject* ptr_of_this_method;
  67. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  68. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  69. System.String @key = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  70. __intp.Free(ptr_of_this_method);
  71. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  72. UnityEngine.GameObject @gameObject = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  73. __intp.Free(ptr_of_this_method);
  74. var result_of_this_method = ETModel.GameObjectHelper.Get<UnityEngine.TextAsset>(@gameObject, @key);
  75. object obj_result_of_this_method = result_of_this_method;
  76. if(obj_result_of_this_method is CrossBindingAdaptorType)
  77. {
  78. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  79. }
  80. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  81. }
  82. static StackObject* Get_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  83. {
  84. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  85. StackObject* ptr_of_this_method;
  86. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  87. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  88. System.String @key = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  89. __intp.Free(ptr_of_this_method);
  90. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  91. UnityEngine.GameObject @gameObject = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  92. __intp.Free(ptr_of_this_method);
  93. var result_of_this_method = ETModel.GameObjectHelper.Get<UnityEngine.GameObject>(@gameObject, @key);
  94. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  95. }
  96. }
  97. }