UnityEngine_GameObject_Binding.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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.GetParameters().Length == 0)
  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.GetParameters().Length == 0)
  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.GetParameters().Length == 0)
  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.GetParameters().Length == 0)
  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.GetParameters().Length == 0)
  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.GetParameters().Length == 0)
  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.GetParameters().Length == 0)
  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. object obj_result_of_this_method = result_of_this_method;
  151. if(obj_result_of_this_method is CrossBindingAdaptorType)
  152. {
  153. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  154. }
  155. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  156. }
  157. static StackObject* set_layer_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  158. {
  159. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  160. StackObject* ptr_of_this_method;
  161. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  162. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  163. System.Int32 @value = ptr_of_this_method->Value;
  164. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  165. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  166. __intp.Free(ptr_of_this_method);
  167. instance_of_this_method.layer = value;
  168. return __ret;
  169. }
  170. static StackObject* AddComponent_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  171. {
  172. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  173. StackObject* ptr_of_this_method;
  174. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  175. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  176. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  177. __intp.Free(ptr_of_this_method);
  178. var result_of_this_method = instance_of_this_method.AddComponent<ETModel.ComponentView>();
  179. object obj_result_of_this_method = result_of_this_method;
  180. if(obj_result_of_this_method is CrossBindingAdaptorType)
  181. {
  182. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  183. }
  184. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  185. }
  186. static StackObject* Find_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  187. {
  188. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  189. StackObject* ptr_of_this_method;
  190. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  191. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  192. System.String @name = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  193. __intp.Free(ptr_of_this_method);
  194. var result_of_this_method = UnityEngine.GameObject.Find(@name);
  195. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  196. }
  197. static StackObject* GetComponent_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  198. {
  199. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  200. StackObject* ptr_of_this_method;
  201. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  202. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  203. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  204. __intp.Free(ptr_of_this_method);
  205. var result_of_this_method = instance_of_this_method.GetComponent<global::ReferenceCollector>();
  206. object obj_result_of_this_method = result_of_this_method;
  207. if(obj_result_of_this_method is CrossBindingAdaptorType)
  208. {
  209. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  210. }
  211. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  212. }
  213. static StackObject* GetComponent_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  214. {
  215. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  216. StackObject* ptr_of_this_method;
  217. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  218. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  219. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  220. __intp.Free(ptr_of_this_method);
  221. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.Button>();
  222. object obj_result_of_this_method = result_of_this_method;
  223. if(obj_result_of_this_method is CrossBindingAdaptorType)
  224. {
  225. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  226. }
  227. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  228. }
  229. static StackObject* GetComponent_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  230. {
  231. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  232. StackObject* ptr_of_this_method;
  233. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  234. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  235. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  236. __intp.Free(ptr_of_this_method);
  237. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.Text>();
  238. object obj_result_of_this_method = result_of_this_method;
  239. if(obj_result_of_this_method is CrossBindingAdaptorType)
  240. {
  241. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  242. }
  243. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  244. }
  245. static StackObject* GetComponent_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  246. {
  247. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  248. StackObject* ptr_of_this_method;
  249. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  250. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  251. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  252. __intp.Free(ptr_of_this_method);
  253. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.UI.InputField>();
  254. object obj_result_of_this_method = result_of_this_method;
  255. if(obj_result_of_this_method is CrossBindingAdaptorType)
  256. {
  257. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  258. }
  259. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  260. }
  261. static StackObject* GetComponent_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  262. {
  263. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  264. StackObject* ptr_of_this_method;
  265. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  266. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  267. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  268. __intp.Free(ptr_of_this_method);
  269. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.Canvas>();
  270. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  271. }
  272. static StackObject* GetComponent_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  273. {
  274. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  275. StackObject* ptr_of_this_method;
  276. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  277. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  278. UnityEngine.GameObject instance_of_this_method = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  279. __intp.Free(ptr_of_this_method);
  280. var result_of_this_method = instance_of_this_method.GetComponent<UnityEngine.Camera>();
  281. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  282. }
  283. static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  284. {
  285. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  286. StackObject* __ret = ILIntepreter.Minus(__esp, 0);
  287. var result_of_this_method = new UnityEngine.GameObject();
  288. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  289. }
  290. }
  291. }