Пример #1
0
    static int AddChild(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
                UnityEngine.GameObject o    = CommonUtils.AddChild(arg0);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 2)
            {
                UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject));
                int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
                UnityEngine.GameObject o = CommonUtils.AddChild(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: CommonUtils.AddChild"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }