Exemplo n.º 1
0
    static int GetLuaComponents(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
                LuaComponent[]         o    = ComponentUtil.GetLuaComponents(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2)
            {
                UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
                string arg1 = ToLua.CheckString(L, 2);
                System.Collections.Generic.List <LuaComponent> o = ComponentUtil.GetLuaComponents(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: ComponentUtil.GetLuaComponents"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }