UnityEngine_GameObject_Binding.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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.Int32)};
  27. method = type.GetMethod("set_layer", flag, null, args, null);
  28. app.RegisterCLRMethodRedirection(method, set_layer_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.ComponentView)};
  44. if (genericMethods.TryGetValue("AddComponent", out lst))
  45. {
  46. foreach(var m in lst)
  47. {
  48. if(m.MatchGenericParameters(args, typeof(ETModel.ComponentView)))
  49. {
  50. method = m.MakeGenericMethod(args);
  51. app.RegisterCLRMethodRedirection(method, AddComponent_2);
  52. break;
  53. }
  54. }
  55. }
  56. args = new Type[]{typeof(System.String)};
  57. method = type.GetMethod("Find", flag, null, args, null);
  58. app.RegisterCLRMethodRedirection(method, Find_3);
  59. args = new Type[]{typeof(global::ReferenceCollector)};
  60. if (genericMethods.TryGetValue("GetComponent", out lst))
  61. {
  62. foreach(var m in lst)
  63. {
  64. if(m.MatchGenericParameters(args, typeof(global::ReferenceCollector)))
  65. {
  66. method = m.MakeGenericMethod(args);
  67. app.RegisterCLRMethodRedirection(method, GetComponent_4);
  68. break;
  69. }
  70. }
  71. }
  72. args = new Type[]{typeof(UnityEngine.UI.Button)};
  73. if (genericMethods.TryGetValue("GetComponent", out lst))
  74. {
  75. foreach(var m in lst)
  76. {
  77. if(m.MatchGenericParameters(args, typeof(UnityEngine.UI.Button)))
  78. {
  79. method = m.MakeGenericMethod(args);
  80. app.RegisterCLRMethodRedirection(method, GetComponent_5);
  81. break;
  82. }
  83. }
  84. }
  85. args = new Type[]{typeof(UnityEngine.UI.Text)};
  86. if (genericMethods.TryGetValue("GetComponent", out lst))
  87. {
  88. foreach(var m in lst)
  89. {
  90. if(m.MatchGenericParameters(args, typeof(UnityEngine.UI.Text)))
  91. {
  92. method = m.MakeGenericMethod(args);
  93. app.RegisterCLRMethodRedirection(method, GetComponent_6);
  94. break;
  95. }
  96. }
  97. }
  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.MatchGenericParameters(args, typeof(UnityEngine.UI.InputField)))
  104. {
  105. method = m.MakeGenericMethod(args);
  106. app.RegisterCLRMethodRedirection(method, GetComponent_7);
  107. break;
  108. }
  109. }
  110. }
  111. args = new Type[]{typeof(UnityEngine.Canvas)};
  112. if (genericMethods.TryGetValue("GetComponent", out lst))
  113. {
  114. foreach(var m in lst)
  115. {
  116. if(m.MatchGenericParameters(args, typeof(UnityEngine.Canvas)))
  117. {
  118. method = m.MakeGenericMethod(args);
  119. app.RegisterCLRMethodRedirection(method, GetComponent_8);
  120. break;
  121. }
  122. }
  123. }
  124. args = new Type[]{typeof(UnityEngine.Camera)};
  125. if (genericMethods.TryGetValue("GetComponent", out lst))
  126. {
  127. foreach(var m in lst)
  128. {
  129. if(m.MatchGenericParameters(args, typeof(UnityEngine.Camera)))
  130. {
  131. method = m.MakeGenericMethod(args);
  132. app.RegisterCLRMethodRedirection(method, GetComponent_9);
  133. break;
  134. }
  135. }
  136. }
  137. args = new Type[]{};
  138. method = type.GetConstructor(flag, null, args, null);
  139. app.RegisterCLRMethodRedirection(method, Ctor_0);
  140. }
  141. static StackObject* get_transform_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  142. {
  143. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  144. StackObject* ptr_of_this_method;
  145. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  146. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  147. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  148. __intp.Free(ptr_of_this_method);
  149. var result_of_this_method = instance_of_this_method.transform;
  150. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  151. }
  152. static StackObject* set_layer_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  153. {
  154. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  155. StackObject* ptr_of_this_method;
  156. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  157. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  158. System.Int32 @value = ptr_of_this_method->Value;
  159. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  160. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  161. __intp.Free(ptr_of_this_method);
  162. instance_of_this_method.layer = value;
  163. return __ret;
  164. }
  165. static StackObject* AddComponent_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  166. {
  167. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  168. StackObject* ptr_of_this_method;
  169. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  170. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  171. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  172. __intp.Free(ptr_of_this_method);
  173. var result_of_this_method = instance_of_this_method.AddComponent<ETModel.ComponentView>();
  174. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  175. }
  176. static StackObject* Find_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  177. {
  178. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  179. StackObject* ptr_of_this_method;
  180. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  181. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  182. System.String @name = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  183. __intp.Free(ptr_of_this_method);
  184. var result_of_this_method = UnityEngine.GameObject.Find(@name);
  185. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  186. }
  187. static StackObject* GetComponent_4(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<global::ReferenceCollector>();
  196. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  197. }
  198. static StackObject* GetComponent_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  199. {
  200. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  201. StackObject* ptr_of_this_method;
  202. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  203. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  204. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  205. __intp.Free(ptr_of_this_method);
  206. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.Button>();
  207. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  208. }
  209. static StackObject* GetComponent_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  210. {
  211. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  212. StackObject* ptr_of_this_method;
  213. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  214. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  215. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  216. __intp.Free(ptr_of_this_method);
  217. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.Text>();
  218. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  219. }
  220. static StackObject* GetComponent_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  221. {
  222. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  223. StackObject* ptr_of_this_method;
  224. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  225. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  226. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  227. __intp.Free(ptr_of_this_method);
  228. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.InputField>();
  229. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  230. }
  231. static StackObject* GetComponent_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  232. {
  233. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  234. StackObject* ptr_of_this_method;
  235. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  236. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  237. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  238. __intp.Free(ptr_of_this_method);
  239. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.Canvas>();
  240. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  241. }
  242. static StackObject* GetComponent_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  243. {
  244. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  245. StackObject* ptr_of_this_method;
  246. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  247. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  248. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  249. __intp.Free(ptr_of_this_method);
  250. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.Camera>();
  251. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  252. }
  253. static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  254. {
  255. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  256. StackObject* __ret = ILIntepreter.Minus(__esp, 0);
  257. var result_of_this_method = new UnityEngine.GameObject();
  258. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  259. }
  260. }
  261. }