ToLua_UnityEngine_GameObject.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. using UnityEngine;
  2. using System.Collections;
  3. using LuaInterface;
  4. using System;
  5. public class ToLua_UnityEngine_GameObject
  6. {
  7. public static string SendMessageDefined =
  8. @" IntPtr L0 = LuaException.L;
  9. try
  10. {
  11. ++LuaException.SendMsgCount;
  12. LuaException.L = L;
  13. int count = LuaDLL.lua_gettop(L);
  14. if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
  15. {
  16. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  17. string arg0 = ToLua.ToString(L, 2);
  18. obj.SendMessage(arg0);
  19. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  20. {
  21. string error = LuaDLL.lua_tostring(L, -1);
  22. LuaDLL.lua_pop(L, 1);
  23. throw new LuaException(error, LuaException.GetLastError());
  24. }
  25. --LuaException.SendMsgCount;
  26. LuaException.L = L0;
  27. return 0;
  28. }
  29. else if (count == 3 && TypeChecker.CheckTypes<string, UnityEngine.SendMessageOptions>(L, 2))
  30. {
  31. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  32. string arg0 = ToLua.ToString(L, 2);
  33. UnityEngine.SendMessageOptions arg1 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 3);
  34. obj.SendMessage(arg0, arg1);
  35. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  36. {
  37. string error = LuaDLL.lua_tostring(L, -1);
  38. LuaDLL.lua_pop(L, 1);
  39. throw new LuaException(error, LuaException.GetLastError());
  40. }
  41. --LuaException.SendMsgCount;
  42. LuaException.L = L0;
  43. return 0;
  44. }
  45. else if (count == 3 && TypeChecker.CheckTypes<string, object>(L, 2))
  46. {
  47. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  48. string arg0 = ToLua.ToString(L, 2);
  49. object arg1 = ToLua.ToVarObject(L, 3);
  50. obj.SendMessage(arg0, arg1);
  51. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  52. {
  53. string error = LuaDLL.lua_tostring(L, -1);
  54. LuaDLL.lua_pop(L, 1);
  55. throw new LuaException(error, LuaException.GetLastError());
  56. }
  57. --LuaException.SendMsgCount;
  58. LuaException.L = L0;
  59. return 0;
  60. }
  61. else if (count == 4 && TypeChecker.CheckTypes<string, object, UnityEngine.SendMessageOptions>(L, 2))
  62. {
  63. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  64. string arg0 = ToLua.ToString(L, 2);
  65. object arg1 = ToLua.ToVarObject(L, 3);
  66. UnityEngine.SendMessageOptions arg2 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 4);
  67. obj.SendMessage(arg0, arg1, arg2);
  68. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  69. {
  70. string error = LuaDLL.lua_tostring(L, -1);
  71. LuaDLL.lua_pop(L, 1);
  72. throw new LuaException(error, LuaException.GetLastError());
  73. }
  74. --LuaException.SendMsgCount;
  75. LuaException.L = L0;
  76. return 0;
  77. }
  78. else
  79. {
  80. --LuaException.SendMsgCount;
  81. LuaException.L = L0;
  82. return LuaDLL.luaL_throw(L, ""invalid arguments to method: UnityEngine.GameObject.SendMessage"");
  83. }
  84. }
  85. catch(Exception e)
  86. {
  87. --LuaException.SendMsgCount;
  88. LuaException.L = L0;
  89. return LuaDLL.toluaL_exception(L, e);
  90. }";
  91. public static string SendMessageUpwardsDefined =
  92. @" IntPtr L0 = LuaException.L;
  93. try
  94. {
  95. ++LuaException.SendMsgCount;
  96. LuaException.L = L;
  97. int count = LuaDLL.lua_gettop(L);
  98. if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
  99. {
  100. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  101. string arg0 = ToLua.ToString(L, 2);
  102. obj.SendMessageUpwards(arg0);
  103. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  104. {
  105. string error = LuaDLL.lua_tostring(L, -1);
  106. LuaDLL.lua_pop(L, 1);
  107. throw new LuaException(error, LuaException.GetLastError());
  108. }
  109. --LuaException.SendMsgCount;
  110. LuaException.L = L0;
  111. return 0;
  112. }
  113. else if (count == 3 && TypeChecker.CheckTypes<string, UnityEngine.SendMessageOptions>(L, 2))
  114. {
  115. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  116. string arg0 = ToLua.ToString(L, 2);
  117. UnityEngine.SendMessageOptions arg1 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 3);
  118. obj.SendMessageUpwards(arg0, arg1);
  119. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  120. {
  121. string error = LuaDLL.lua_tostring(L, -1);
  122. LuaDLL.lua_pop(L, 1);
  123. throw new LuaException(error, LuaException.GetLastError());
  124. }
  125. --LuaException.SendMsgCount;
  126. LuaException.L = L0;
  127. return 0;
  128. }
  129. else if (count == 3 && TypeChecker.CheckTypes<string, object>(L, 2))
  130. {
  131. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  132. string arg0 = ToLua.ToString(L, 2);
  133. object arg1 = ToLua.ToVarObject(L, 3);
  134. obj.SendMessageUpwards(arg0, arg1);
  135. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  136. {
  137. string error = LuaDLL.lua_tostring(L, -1);
  138. LuaDLL.lua_pop(L, 1);
  139. throw new LuaException(error, LuaException.GetLastError());
  140. }
  141. --LuaException.SendMsgCount;
  142. LuaException.L = L0;
  143. return 0;
  144. }
  145. else if (count == 4 && TypeChecker.CheckTypes<string, object, UnityEngine.SendMessageOptions>(L, 2))
  146. {
  147. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  148. string arg0 = ToLua.ToString(L, 2);
  149. object arg1 = ToLua.ToVarObject(L, 3);
  150. UnityEngine.SendMessageOptions arg2 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 4);
  151. obj.SendMessageUpwards(arg0, arg1, arg2);
  152. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  153. {
  154. string error = LuaDLL.lua_tostring(L, -1);
  155. LuaDLL.lua_pop(L, 1);
  156. throw new LuaException(error, LuaException.GetLastError());
  157. }
  158. --LuaException.SendMsgCount;
  159. LuaException.L = L0;
  160. return 0;
  161. }
  162. else
  163. {
  164. --LuaException.SendMsgCount;
  165. LuaException.L = L0;
  166. return LuaDLL.luaL_throw(L, ""invalid arguments to method: UnityEngine.GameObject.SendMessageUpwards"");
  167. }
  168. }
  169. catch (Exception e)
  170. {
  171. --LuaException.SendMsgCount;
  172. LuaException.L = L0;
  173. return LuaDLL.toluaL_exception(L, e);
  174. }";
  175. public static string BroadcastMessageDefined =
  176. @" IntPtr L0 = LuaException.L;
  177. try
  178. {
  179. ++LuaException.SendMsgCount;
  180. LuaException.L = L;
  181. int count = LuaDLL.lua_gettop(L);
  182. if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
  183. {
  184. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  185. string arg0 = ToLua.ToString(L, 2);
  186. obj.BroadcastMessage(arg0);
  187. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  188. {
  189. string error = LuaDLL.lua_tostring(L, -1);
  190. LuaDLL.lua_pop(L, 1);
  191. throw new LuaException(error, LuaException.GetLastError());
  192. }
  193. --LuaException.SendMsgCount;
  194. LuaException.L = L0;
  195. return 0;
  196. }
  197. else if (count == 3 && TypeChecker.CheckTypes<string, UnityEngine.SendMessageOptions>(L, 2))
  198. {
  199. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  200. string arg0 = ToLua.ToString(L, 2);
  201. UnityEngine.SendMessageOptions arg1 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 3);
  202. obj.BroadcastMessage(arg0, arg1);
  203. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  204. {
  205. string error = LuaDLL.lua_tostring(L, -1);
  206. LuaDLL.lua_pop(L, 1);
  207. throw new LuaException(error, LuaException.GetLastError());
  208. }
  209. --LuaException.SendMsgCount;
  210. LuaException.L = L0;
  211. return 0;
  212. }
  213. else if (count == 3 && TypeChecker.CheckTypes<string, object>(L, 2))
  214. {
  215. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  216. string arg0 = ToLua.ToString(L, 2);
  217. object arg1 = ToLua.ToVarObject(L, 3);
  218. obj.BroadcastMessage(arg0, arg1);
  219. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  220. {
  221. string error = LuaDLL.lua_tostring(L, -1);
  222. LuaDLL.lua_pop(L, 1);
  223. throw new LuaException(error, LuaException.GetLastError());
  224. }
  225. --LuaException.SendMsgCount;
  226. LuaException.L = L0;
  227. return 0;
  228. }
  229. else if (count == 4 && TypeChecker.CheckTypes<string, object, UnityEngine.SendMessageOptions>(L, 2))
  230. {
  231. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  232. string arg0 = ToLua.ToString(L, 2);
  233. object arg1 = ToLua.ToVarObject(L, 3);
  234. UnityEngine.SendMessageOptions arg2 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 4);
  235. obj.BroadcastMessage(arg0, arg1, arg2);
  236. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  237. {
  238. string error = LuaDLL.lua_tostring(L, -1);
  239. LuaDLL.lua_pop(L, 1);
  240. throw new LuaException(error, LuaException.GetLastError());
  241. }
  242. --LuaException.SendMsgCount;
  243. LuaException.L = L0;
  244. return 0;
  245. }
  246. else
  247. {
  248. --LuaException.SendMsgCount;
  249. LuaException.L = L0;
  250. return LuaDLL.luaL_throw(L, ""invalid arguments to method: UnityEngine.GameObject.BroadcastMessage"");
  251. }
  252. }
  253. catch (Exception e)
  254. {
  255. --LuaException.SendMsgCount;
  256. LuaException.L = L0;
  257. return LuaDLL.toluaL_exception(L, e);
  258. }";
  259. public static string AddComponentDefined =
  260. @" IntPtr L0 = LuaException.L;
  261. try
  262. {
  263. ++LuaException.InstantiateCount;
  264. LuaException.L = L;
  265. ToLua.CheckArgsCount(L, 2);
  266. UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
  267. System.Type arg0 = ToLua.CheckMonoType(L, 2);
  268. UnityEngine.Component o = obj.AddComponent(arg0);
  269. if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
  270. {
  271. string error = LuaDLL.lua_tostring(L, -1);
  272. LuaDLL.lua_pop(L, 1);
  273. throw new LuaException(error, LuaException.GetLastError());
  274. }
  275. ToLua.Push(L, o);
  276. LuaException.L = L0;
  277. --LuaException.InstantiateCount;
  278. return 1;
  279. }
  280. catch (Exception e)
  281. {
  282. LuaException.L = L0;
  283. --LuaException.InstantiateCount;
  284. return LuaDLL.toluaL_exception(L, e);
  285. }";
  286. [UseDefinedAttribute]
  287. public void SendMessage(string methodName)
  288. {
  289. }
  290. [UseDefinedAttribute]
  291. public void SendMessageUpwards(string methodName)
  292. {
  293. }
  294. [UseDefinedAttribute]
  295. public void BroadcastMessage(string methodName)
  296. {
  297. }
  298. [UseDefinedAttribute]
  299. public void AddComponent(Type t)
  300. {
  301. }
  302. }