源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

522 lines
14 KiB

  1. //this source code was auto-generated by tolua#, do not modify it
  2. using System;
  3. using LuaInterface;
  4. public class UnityEngine_FontWrap
  5. {
  6. public static void Register(LuaState L)
  7. {
  8. L.BeginClass(typeof(UnityEngine.Font), typeof(UnityEngine.Object));
  9. L.RegFunction("CreateDynamicFontFromOSFont", CreateDynamicFontFromOSFont);
  10. L.RegFunction("GetMaxVertsForString", GetMaxVertsForString);
  11. L.RegFunction("HasCharacter", HasCharacter);
  12. L.RegFunction("GetOSInstalledFontNames", GetOSInstalledFontNames);
  13. L.RegFunction("GetPathsToOSFonts", GetPathsToOSFonts);
  14. L.RegFunction("GetCharacterInfo", GetCharacterInfo);
  15. L.RegFunction("RequestCharactersInTexture", RequestCharactersInTexture);
  16. L.RegFunction("New", _CreateUnityEngine_Font);
  17. L.RegFunction("__eq", op_Equality);
  18. L.RegFunction("__tostring", ToLua.op_ToString);
  19. L.RegVar("material", get_material, set_material);
  20. L.RegVar("fontNames", get_fontNames, set_fontNames);
  21. L.RegVar("dynamic", get_dynamic, null);
  22. L.RegVar("ascent", get_ascent, null);
  23. L.RegVar("fontSize", get_fontSize, null);
  24. L.RegVar("characterInfo", get_characterInfo, set_characterInfo);
  25. L.RegVar("lineHeight", get_lineHeight, null);
  26. L.RegVar("textureRebuilt", get_textureRebuilt, set_textureRebuilt);
  27. L.EndClass();
  28. }
  29. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  30. static int _CreateUnityEngine_Font(IntPtr L)
  31. {
  32. try
  33. {
  34. int count = LuaDLL.lua_gettop(L);
  35. if (count == 0)
  36. {
  37. UnityEngine.Font obj = new UnityEngine.Font();
  38. ToLua.Push(L, obj);
  39. return 1;
  40. }
  41. else if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(string)))
  42. {
  43. string arg0 = ToLua.CheckString(L, 1);
  44. UnityEngine.Font obj = new UnityEngine.Font(arg0);
  45. ToLua.Push(L, obj);
  46. return 1;
  47. }
  48. else
  49. {
  50. return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.Font.New");
  51. }
  52. }
  53. catch(Exception e)
  54. {
  55. return LuaDLL.toluaL_exception(L, e);
  56. }
  57. }
  58. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  59. static int CreateDynamicFontFromOSFont(IntPtr L)
  60. {
  61. try
  62. {
  63. int count = LuaDLL.lua_gettop(L);
  64. if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(int)))
  65. {
  66. string arg0 = ToLua.ToString(L, 1);
  67. int arg1 = (int)LuaDLL.lua_tonumber(L, 2);
  68. UnityEngine.Font o = UnityEngine.Font.CreateDynamicFontFromOSFont(arg0, arg1);
  69. ToLua.Push(L, o);
  70. return 1;
  71. }
  72. else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(string[]), typeof(int)))
  73. {
  74. string[] arg0 = ToLua.CheckStringArray(L, 1);
  75. int arg1 = (int)LuaDLL.lua_tonumber(L, 2);
  76. UnityEngine.Font o = UnityEngine.Font.CreateDynamicFontFromOSFont(arg0, arg1);
  77. ToLua.Push(L, o);
  78. return 1;
  79. }
  80. else
  81. {
  82. return LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Font.CreateDynamicFontFromOSFont");
  83. }
  84. }
  85. catch(Exception e)
  86. {
  87. return LuaDLL.toluaL_exception(L, e);
  88. }
  89. }
  90. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  91. static int GetMaxVertsForString(IntPtr L)
  92. {
  93. try
  94. {
  95. ToLua.CheckArgsCount(L, 1);
  96. string arg0 = ToLua.CheckString(L, 1);
  97. int o = UnityEngine.Font.GetMaxVertsForString(arg0);
  98. LuaDLL.lua_pushinteger(L, o);
  99. return 1;
  100. }
  101. catch(Exception e)
  102. {
  103. return LuaDLL.toluaL_exception(L, e);
  104. }
  105. }
  106. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  107. static int HasCharacter(IntPtr L)
  108. {
  109. try
  110. {
  111. ToLua.CheckArgsCount(L, 2);
  112. UnityEngine.Font obj = (UnityEngine.Font)ToLua.CheckObject(L, 1, typeof(UnityEngine.Font));
  113. char arg0 = (char)LuaDLL.luaL_checknumber(L, 2);
  114. bool o = obj.HasCharacter(arg0);
  115. LuaDLL.lua_pushboolean(L, o);
  116. return 1;
  117. }
  118. catch(Exception e)
  119. {
  120. return LuaDLL.toluaL_exception(L, e);
  121. }
  122. }
  123. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  124. static int GetOSInstalledFontNames(IntPtr L)
  125. {
  126. try
  127. {
  128. ToLua.CheckArgsCount(L, 0);
  129. string[] o = UnityEngine.Font.GetOSInstalledFontNames();
  130. ToLua.Push(L, o);
  131. return 1;
  132. }
  133. catch(Exception e)
  134. {
  135. return LuaDLL.toluaL_exception(L, e);
  136. }
  137. }
  138. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  139. static int GetPathsToOSFonts(IntPtr L)
  140. {
  141. try
  142. {
  143. ToLua.CheckArgsCount(L, 0);
  144. string[] o = UnityEngine.Font.GetPathsToOSFonts();
  145. ToLua.Push(L, o);
  146. return 1;
  147. }
  148. catch(Exception e)
  149. {
  150. return LuaDLL.toluaL_exception(L, e);
  151. }
  152. }
  153. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  154. static int GetCharacterInfo(IntPtr L)
  155. {
  156. try
  157. {
  158. int count = LuaDLL.lua_gettop(L);
  159. if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Font), typeof(char)))
  160. {
  161. UnityEngine.Font obj = (UnityEngine.Font)ToLua.ToObject(L, 1);
  162. char arg0 = (char)LuaDLL.lua_tonumber(L, 2);
  163. UnityEngine.CharacterInfo arg1;
  164. bool o = obj.GetCharacterInfo(arg0, out arg1);
  165. LuaDLL.lua_pushboolean(L, o);
  166. ToLua.PushValue(L, arg1);
  167. return 2;
  168. }
  169. else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Font), typeof(char), typeof(int)))
  170. {
  171. UnityEngine.Font obj = (UnityEngine.Font)ToLua.ToObject(L, 1);
  172. char arg0 = (char)LuaDLL.lua_tonumber(L, 2);
  173. UnityEngine.CharacterInfo arg1;
  174. int arg2 = (int)LuaDLL.lua_tonumber(L, 4);
  175. bool o = obj.GetCharacterInfo(arg0, out arg1, arg2);
  176. LuaDLL.lua_pushboolean(L, o);
  177. ToLua.PushValue(L, arg1);
  178. return 2;
  179. }
  180. else if (count == 5 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Font), typeof(char), typeof(int), typeof(UnityEngine.FontStyle)))
  181. {
  182. UnityEngine.Font obj = (UnityEngine.Font)ToLua.ToObject(L, 1);
  183. char arg0 = (char)LuaDLL.lua_tonumber(L, 2);
  184. UnityEngine.CharacterInfo arg1;
  185. int arg2 = (int)LuaDLL.lua_tonumber(L, 4);
  186. UnityEngine.FontStyle arg3 = (UnityEngine.FontStyle)ToLua.ToObject(L, 5);
  187. bool o = obj.GetCharacterInfo(arg0, out arg1, arg2, arg3);
  188. LuaDLL.lua_pushboolean(L, o);
  189. ToLua.PushValue(L, arg1);
  190. return 2;
  191. }
  192. else
  193. {
  194. return LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Font.GetCharacterInfo");
  195. }
  196. }
  197. catch(Exception e)
  198. {
  199. return LuaDLL.toluaL_exception(L, e);
  200. }
  201. }
  202. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  203. static int RequestCharactersInTexture(IntPtr L)
  204. {
  205. try
  206. {
  207. int count = LuaDLL.lua_gettop(L);
  208. if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Font), typeof(string)))
  209. {
  210. UnityEngine.Font obj = (UnityEngine.Font)ToLua.ToObject(L, 1);
  211. string arg0 = ToLua.ToString(L, 2);
  212. obj.RequestCharactersInTexture(arg0);
  213. return 0;
  214. }
  215. else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Font), typeof(string), typeof(int)))
  216. {
  217. UnityEngine.Font obj = (UnityEngine.Font)ToLua.ToObject(L, 1);
  218. string arg0 = ToLua.ToString(L, 2);
  219. int arg1 = (int)LuaDLL.lua_tonumber(L, 3);
  220. obj.RequestCharactersInTexture(arg0, arg1);
  221. return 0;
  222. }
  223. else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Font), typeof(string), typeof(int), typeof(UnityEngine.FontStyle)))
  224. {
  225. UnityEngine.Font obj = (UnityEngine.Font)ToLua.ToObject(L, 1);
  226. string arg0 = ToLua.ToString(L, 2);
  227. int arg1 = (int)LuaDLL.lua_tonumber(L, 3);
  228. UnityEngine.FontStyle arg2 = (UnityEngine.FontStyle)ToLua.ToObject(L, 4);
  229. obj.RequestCharactersInTexture(arg0, arg1, arg2);
  230. return 0;
  231. }
  232. else
  233. {
  234. return LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Font.RequestCharactersInTexture");
  235. }
  236. }
  237. catch(Exception e)
  238. {
  239. return LuaDLL.toluaL_exception(L, e);
  240. }
  241. }
  242. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  243. static int op_Equality(IntPtr L)
  244. {
  245. try
  246. {
  247. ToLua.CheckArgsCount(L, 2);
  248. UnityEngine.Object arg0 = (UnityEngine.Object)ToLua.ToObject(L, 1);
  249. UnityEngine.Object arg1 = (UnityEngine.Object)ToLua.ToObject(L, 2);
  250. bool o = arg0 == arg1;
  251. LuaDLL.lua_pushboolean(L, o);
  252. return 1;
  253. }
  254. catch(Exception e)
  255. {
  256. return LuaDLL.toluaL_exception(L, e);
  257. }
  258. }
  259. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  260. static int get_material(IntPtr L)
  261. {
  262. object o = null;
  263. try
  264. {
  265. o = ToLua.ToObject(L, 1);
  266. UnityEngine.Font obj = (UnityEngine.Font)o;
  267. UnityEngine.Material ret = obj.material;
  268. ToLua.Push(L, ret);
  269. return 1;
  270. }
  271. catch(Exception e)
  272. {
  273. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index material on a nil value" : e.Message);
  274. }
  275. }
  276. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  277. static int get_fontNames(IntPtr L)
  278. {
  279. object o = null;
  280. try
  281. {
  282. o = ToLua.ToObject(L, 1);
  283. UnityEngine.Font obj = (UnityEngine.Font)o;
  284. string[] ret = obj.fontNames;
  285. ToLua.Push(L, ret);
  286. return 1;
  287. }
  288. catch(Exception e)
  289. {
  290. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index fontNames on a nil value" : e.Message);
  291. }
  292. }
  293. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  294. static int get_dynamic(IntPtr L)
  295. {
  296. object o = null;
  297. try
  298. {
  299. o = ToLua.ToObject(L, 1);
  300. UnityEngine.Font obj = (UnityEngine.Font)o;
  301. bool ret = obj.dynamic;
  302. LuaDLL.lua_pushboolean(L, ret);
  303. return 1;
  304. }
  305. catch(Exception e)
  306. {
  307. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index dynamic on a nil value" : e.Message);
  308. }
  309. }
  310. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  311. static int get_ascent(IntPtr L)
  312. {
  313. object o = null;
  314. try
  315. {
  316. o = ToLua.ToObject(L, 1);
  317. UnityEngine.Font obj = (UnityEngine.Font)o;
  318. int ret = obj.ascent;
  319. LuaDLL.lua_pushinteger(L, ret);
  320. return 1;
  321. }
  322. catch(Exception e)
  323. {
  324. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index ascent on a nil value" : e.Message);
  325. }
  326. }
  327. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  328. static int get_fontSize(IntPtr L)
  329. {
  330. object o = null;
  331. try
  332. {
  333. o = ToLua.ToObject(L, 1);
  334. UnityEngine.Font obj = (UnityEngine.Font)o;
  335. int ret = obj.fontSize;
  336. LuaDLL.lua_pushinteger(L, ret);
  337. return 1;
  338. }
  339. catch(Exception e)
  340. {
  341. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index fontSize on a nil value" : e.Message);
  342. }
  343. }
  344. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  345. static int get_characterInfo(IntPtr L)
  346. {
  347. object o = null;
  348. try
  349. {
  350. o = ToLua.ToObject(L, 1);
  351. UnityEngine.Font obj = (UnityEngine.Font)o;
  352. UnityEngine.CharacterInfo[] ret = obj.characterInfo;
  353. ToLua.Push(L, ret);
  354. return 1;
  355. }
  356. catch(Exception e)
  357. {
  358. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index characterInfo on a nil value" : e.Message);
  359. }
  360. }
  361. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  362. static int get_lineHeight(IntPtr L)
  363. {
  364. object o = null;
  365. try
  366. {
  367. o = ToLua.ToObject(L, 1);
  368. UnityEngine.Font obj = (UnityEngine.Font)o;
  369. int ret = obj.lineHeight;
  370. LuaDLL.lua_pushinteger(L, ret);
  371. return 1;
  372. }
  373. catch(Exception e)
  374. {
  375. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index lineHeight on a nil value" : e.Message);
  376. }
  377. }
  378. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  379. static int get_textureRebuilt(IntPtr L)
  380. {
  381. ToLua.Push(L, new EventObject("UnityEngine.Font.textureRebuilt"));
  382. return 1;
  383. }
  384. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  385. static int set_material(IntPtr L)
  386. {
  387. object o = null;
  388. try
  389. {
  390. o = ToLua.ToObject(L, 1);
  391. UnityEngine.Font obj = (UnityEngine.Font)o;
  392. UnityEngine.Material arg0 = (UnityEngine.Material)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Material));
  393. obj.material = arg0;
  394. return 0;
  395. }
  396. catch(Exception e)
  397. {
  398. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index material on a nil value" : e.Message);
  399. }
  400. }
  401. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  402. static int set_fontNames(IntPtr L)
  403. {
  404. object o = null;
  405. try
  406. {
  407. o = ToLua.ToObject(L, 1);
  408. UnityEngine.Font obj = (UnityEngine.Font)o;
  409. string[] arg0 = ToLua.CheckStringArray(L, 2);
  410. obj.fontNames = arg0;
  411. return 0;
  412. }
  413. catch(Exception e)
  414. {
  415. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index fontNames on a nil value" : e.Message);
  416. }
  417. }
  418. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  419. static int set_characterInfo(IntPtr L)
  420. {
  421. object o = null;
  422. try
  423. {
  424. o = ToLua.ToObject(L, 1);
  425. UnityEngine.Font obj = (UnityEngine.Font)o;
  426. UnityEngine.CharacterInfo[] arg0 = ToLua.CheckObjectArray<UnityEngine.CharacterInfo>(L, 2);
  427. obj.characterInfo = arg0;
  428. return 0;
  429. }
  430. catch(Exception e)
  431. {
  432. return LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index characterInfo on a nil value" : e.Message);
  433. }
  434. }
  435. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  436. static int set_textureRebuilt(IntPtr L)
  437. {
  438. try
  439. {
  440. EventObject arg0 = null;
  441. if (LuaDLL.lua_isuserdata(L, 2) != 0)
  442. {
  443. arg0 = (EventObject)ToLua.ToObject(L, 2);
  444. }
  445. else
  446. {
  447. return LuaDLL.luaL_throw(L, "The event 'UnityEngine.Font.textureRebuilt' can only appear on the left hand side of += or -= when used outside of the type 'UnityEngine.Font'");
  448. }
  449. if (arg0.op == EventOp.Add)
  450. {
  451. System.Action<UnityEngine.Font> ev = (System.Action<UnityEngine.Font>)DelegateFactory.CreateDelegate(typeof(System.Action<UnityEngine.Font>), arg0.func);
  452. UnityEngine.Font.textureRebuilt += ev;
  453. }
  454. else if (arg0.op == EventOp.Sub)
  455. {
  456. System.Action<UnityEngine.Font> ev = (System.Action<UnityEngine.Font>)LuaMisc.GetEventHandler(null, typeof(UnityEngine.Font), "textureRebuilt");
  457. Delegate[] ds = ev.GetInvocationList();
  458. LuaState state = LuaState.Get(L);
  459. for (int i = 0; i < ds.Length; i++)
  460. {
  461. ev = (System.Action<UnityEngine.Font>)ds[i];
  462. LuaDelegate ld = ev.Target as LuaDelegate;
  463. if (ld != null && ld.func == arg0.func)
  464. {
  465. UnityEngine.Font.textureRebuilt -= ev;
  466. state.DelayDispose(ld.func);
  467. break;
  468. }
  469. }
  470. arg0.func.Dispose();
  471. }
  472. return 0;
  473. }
  474. catch(Exception e)
  475. {
  476. return LuaDLL.toluaL_exception(L, e);
  477. }
  478. }
  479. }