UnityEngine_GameObject_Binding.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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 UnityEngine_GameObject_Binding
  16. {
  17. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  18. {
  19. BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
  20. MethodBase method;
  21. Type[] args;
  22. Type type = typeof(UnityEngine.GameObject);
  23. args = new Type[]{};
  24. method = type.GetMethod("get_transform", flag, null, args, null);
  25. app.RegisterCLRMethodRedirection(method, get_transform_0);
  26. args = new Type[]{typeof(System.String)};
  27. method = type.GetMethod("Find", flag, null, args, null);
  28. app.RegisterCLRMethodRedirection(method, Find_1);
  29. Dictionary<string, List<MethodInfo>> genericMethods = new Dictionary<string, List<MethodInfo>>();
  30. List<MethodInfo> lst = null;
  31. foreach(var m in type.GetMethods())
  32. {
  33. if(m.IsGenericMethodDefinition)
  34. {
  35. if (!genericMethods.TryGetValue(m.Name, out lst))
  36. {
  37. lst = new List<MethodInfo>();
  38. genericMethods[m.Name] = lst;
  39. }
  40. lst.Add(m);
  41. }
  42. }
  43. args = new Type[]{typeof(ETModel.CanvasConfig)};
  44. if (genericMethods.TryGetValue("GetComponent", out lst))
  45. {
  46. foreach(var m in lst)
  47. {
  48. if(m.GetParameters().Length == 0)
  49. {
  50. method = m.MakeGenericMethod(args);
  51. app.RegisterCLRMethodRedirection(method, GetComponent_2);
  52. break;
  53. }
  54. }
  55. }
  56. args = new Type[]{typeof(global::ReferenceCollector)};
  57. if (genericMethods.TryGetValue("GetComponent", out lst))
  58. {
  59. foreach(var m in lst)
  60. {
  61. if(m.GetParameters().Length == 0)
  62. {
  63. method = m.MakeGenericMethod(args);
  64. app.RegisterCLRMethodRedirection(method, GetComponent_3);
  65. break;
  66. }
  67. }
  68. }
  69. args = new Type[]{typeof(UnityEngine.UI.Button)};
  70. if (genericMethods.TryGetValue("GetComponent", out lst))
  71. {
  72. foreach(var m in lst)
  73. {
  74. if(m.GetParameters().Length == 0)
  75. {
  76. method = m.MakeGenericMethod(args);
  77. app.RegisterCLRMethodRedirection(method, GetComponent_4);
  78. break;
  79. }
  80. }
  81. }
  82. args = new Type[]{typeof(UnityEngine.UI.Text)};
  83. if (genericMethods.TryGetValue("GetComponent", out lst))
  84. {
  85. foreach(var m in lst)
  86. {
  87. if(m.GetParameters().Length == 0)
  88. {
  89. method = m.MakeGenericMethod(args);
  90. app.RegisterCLRMethodRedirection(method, GetComponent_5);
  91. break;
  92. }
  93. }
  94. }
  95. args = new Type[]{typeof(System.Int32)};
  96. method = type.GetMethod("set_layer", flag, null, args, null);
  97. app.RegisterCLRMethodRedirection(method, set_layer_6);
  98. args = new Type[]{typeof(UnityEngine.UI.InputField)};
  99. if (genericMethods.TryGetValue("GetComponent", out lst))
  100. {
  101. foreach(var m in lst)
  102. {
  103. if(m.GetParameters().Length == 0)
  104. {
  105. method = m.MakeGenericMethod(args);
  106. app.RegisterCLRMethodRedirection(method, GetComponent_7);
  107. break;
  108. }
  109. }
  110. }
  111. }
  112. static StackObject* get_transform_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  113. {
  114. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  115. StackObject* ptr_of_this_method;
  116. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  117. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  118. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  119. __intp.Free(ptr_of_this_method);
  120. var result_of_this_method = instance_of_this_method.transform;
  121. object obj_result_of_this_method = result_of_this_method;
  122. if(obj_result_of_this_method is CrossBindingAdaptorType)
  123. {
  124. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  125. }
  126. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  127. }
  128. static StackObject* Find_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  129. {
  130. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  131. StackObject* ptr_of_this_method;
  132. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  133. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  134. System.String @name = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  135. __intp.Free(ptr_of_this_method);
  136. var result_of_this_method = UnityEngine.GameObject.Find(@name);
  137. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  138. }
  139. static StackObject* GetComponent_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  140. {
  141. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  142. StackObject* ptr_of_this_method;
  143. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  144. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  145. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  146. __intp.Free(ptr_of_this_method);
  147. var result_of_this_method = instance_of_this_method.GetComponent<ETModel.CanvasConfig>();
  148. object obj_result_of_this_method = result_of_this_method;
  149. if(obj_result_of_this_method is CrossBindingAdaptorType)
  150. {
  151. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  152. }
  153. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  154. }
  155. static StackObject* GetComponent_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  156. {
  157. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  158. StackObject* ptr_of_this_method;
  159. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  160. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  161. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  162. __intp.Free(ptr_of_this_method);
  163. var result_of_this_method = instance_of_this_method.GetComponent<global::ReferenceCollector>();
  164. object obj_result_of_this_method = result_of_this_method;
  165. if(obj_result_of_this_method is CrossBindingAdaptorType)
  166. {
  167. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  168. }
  169. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  170. }
  171. static StackObject* GetComponent_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  172. {
  173. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  174. StackObject* ptr_of_this_method;
  175. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  176. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  177. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  178. __intp.Free(ptr_of_this_method);
  179. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.Button>();
  180. object obj_result_of_this_method = result_of_this_method;
  181. if(obj_result_of_this_method is CrossBindingAdaptorType)
  182. {
  183. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  184. }
  185. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  186. }
  187. static StackObject* GetComponent_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  188. {
  189. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  190. StackObject* ptr_of_this_method;
  191. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  192. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  193. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  194. __intp.Free(ptr_of_this_method);
  195. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.Text>();
  196. object obj_result_of_this_method = result_of_this_method;
  197. if(obj_result_of_this_method is CrossBindingAdaptorType)
  198. {
  199. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  200. }
  201. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  202. }
  203. static StackObject* set_layer_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  204. {
  205. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  206. StackObject* ptr_of_this_method;
  207. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  208. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  209. System.Int32 @value = ptr_of_this_method->Value;
  210. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  211. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  212. __intp.Free(ptr_of_this_method);
  213. instance_of_this_method.layer = value;
  214. return __ret;
  215. }
  216. static StackObject* GetComponent_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  217. {
  218. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  219. StackObject* ptr_of_this_method;
  220. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  221. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  222. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  223. __intp.Free(ptr_of_this_method);
  224. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.InputField>();
  225. object obj_result_of_this_method = result_of_this_method;
  226. if(obj_result_of_this_method is CrossBindingAdaptorType)
  227. {
  228. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  229. }
  230. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  231. }
  232. }
  233. }