| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- using UnityEngine;
- using System.Collections;
- using LuaInterface;
- using System;
- public class ToLua_UnityEngine_GameObject
- {
- public static string SendMessageDefined =
- @" IntPtr L0 = LuaException.L;
- try
- {
- ++LuaException.SendMsgCount;
- LuaException.L = L;
- int count = LuaDLL.lua_gettop(L);
- if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- obj.SendMessage(arg0);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
-
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 3 && TypeChecker.CheckTypes<string, UnityEngine.SendMessageOptions>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- UnityEngine.SendMessageOptions arg1 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 3);
- obj.SendMessage(arg0, arg1);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 3 && TypeChecker.CheckTypes<string, object>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- object arg1 = ToLua.ToVarObject(L, 3);
- obj.SendMessage(arg0, arg1);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 4 && TypeChecker.CheckTypes<string, object, UnityEngine.SendMessageOptions>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- object arg1 = ToLua.ToVarObject(L, 3);
- UnityEngine.SendMessageOptions arg2 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 4);
- obj.SendMessage(arg0, arg1, arg2);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else
- {
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return LuaDLL.luaL_throw(L, ""invalid arguments to method: UnityEngine.GameObject.SendMessage"");
- }
- }
- catch(Exception e)
- {
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return LuaDLL.toluaL_exception(L, e);
- }";
- public static string SendMessageUpwardsDefined =
- @" IntPtr L0 = LuaException.L;
- try
- {
- ++LuaException.SendMsgCount;
- LuaException.L = L;
- int count = LuaDLL.lua_gettop(L);
- if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- obj.SendMessageUpwards(arg0);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 3 && TypeChecker.CheckTypes<string, UnityEngine.SendMessageOptions>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- UnityEngine.SendMessageOptions arg1 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 3);
- obj.SendMessageUpwards(arg0, arg1);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 3 && TypeChecker.CheckTypes<string, object>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- object arg1 = ToLua.ToVarObject(L, 3);
- obj.SendMessageUpwards(arg0, arg1);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 4 && TypeChecker.CheckTypes<string, object, UnityEngine.SendMessageOptions>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- object arg1 = ToLua.ToVarObject(L, 3);
- UnityEngine.SendMessageOptions arg2 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 4);
- obj.SendMessageUpwards(arg0, arg1, arg2);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else
- {
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return LuaDLL.luaL_throw(L, ""invalid arguments to method: UnityEngine.GameObject.SendMessageUpwards"");
- }
- }
- catch (Exception e)
- {
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return LuaDLL.toluaL_exception(L, e);
- }";
- public static string BroadcastMessageDefined =
- @" IntPtr L0 = LuaException.L;
-
- try
- {
- ++LuaException.SendMsgCount;
- LuaException.L = L;
- int count = LuaDLL.lua_gettop(L);
- if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- obj.BroadcastMessage(arg0);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 3 && TypeChecker.CheckTypes<string, UnityEngine.SendMessageOptions>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- UnityEngine.SendMessageOptions arg1 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 3);
- obj.BroadcastMessage(arg0, arg1);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 3 && TypeChecker.CheckTypes<string, object>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- object arg1 = ToLua.ToVarObject(L, 3);
- obj.BroadcastMessage(arg0, arg1);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else if (count == 4 && TypeChecker.CheckTypes<string, object, UnityEngine.SendMessageOptions>(L, 2))
- {
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- string arg0 = ToLua.ToString(L, 2);
- object arg1 = ToLua.ToVarObject(L, 3);
- UnityEngine.SendMessageOptions arg2 = (UnityEngine.SendMessageOptions)ToLua.ToObject(L, 4);
- obj.BroadcastMessage(arg0, arg1, arg2);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return 0;
- }
- else
- {
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return LuaDLL.luaL_throw(L, ""invalid arguments to method: UnityEngine.GameObject.BroadcastMessage"");
- }
- }
- catch (Exception e)
- {
- --LuaException.SendMsgCount;
- LuaException.L = L0;
- return LuaDLL.toluaL_exception(L, e);
- }";
- public static string AddComponentDefined =
- @" IntPtr L0 = LuaException.L;
- try
- {
- ++LuaException.InstantiateCount;
- LuaException.L = L;
- ToLua.CheckArgsCount(L, 2);
- UnityEngine.GameObject obj = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
- System.Type arg0 = ToLua.CheckMonoType(L, 2);
- UnityEngine.Component o = obj.AddComponent(arg0);
- if (LuaDLL.lua_toboolean(L, LuaDLL.lua_upvalueindex(1)))
- {
- string error = LuaDLL.lua_tostring(L, -1);
- LuaDLL.lua_pop(L, 1);
- throw new LuaException(error, LuaException.GetLastError());
- }
- ToLua.Push(L, o);
- LuaException.L = L0;
- --LuaException.InstantiateCount;
- return 1;
- }
- catch (Exception e)
- {
- LuaException.L = L0;
- --LuaException.InstantiateCount;
- return LuaDLL.toluaL_exception(L, e);
- }";
- [UseDefinedAttribute]
- public void SendMessage(string methodName)
- {
- }
- [UseDefinedAttribute]
- public void SendMessageUpwards(string methodName)
- {
- }
- [UseDefinedAttribute]
- public void BroadcastMessage(string methodName)
- {
- }
- [UseDefinedAttribute]
- public void AddComponent(Type t)
- {
- }
- }
|