Exemple #1
0
    static int Destroy(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1)
        {
            Object arg0 = (Object)L.ToUserData(1);
            MetaMethods.__gc(L);
            Object.Destroy(arg0);
            return(0);
        }
        else if (count == 2)
        {
            Object arg0 = (Object)L.ToUserData(1);
            float  arg1 = (float)L.ChkNumber(2);
            Object.Destroy(arg0, arg1);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: Object.Destroy");
        }

        return(0);
    }
Exemple #2
0
    static int DestroyImmediate(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1)
        {
            Object arg0 = (Object)L.ToUserData(1);
            MetaMethods.__gc(L);
            Object.DestroyImmediate(arg0);
            return(0);
        }
        else if (count == 2)
        {
            Object arg0 = (Object)L.ToUserData(1);
            bool   arg1 = L.ChkBoolean(2);
            Object.DestroyImmediate(arg0, arg1);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: Object.DestroyImmediate");
        }

        return(0);
    }
Exemple #3
0
    private static int Delete(ILuaState lua)
    {
        Object obj   = lua.ToUnityObject(1);
        float  delay = (float)lua.OptNumber(2, 0f);

        if (obj != null)
        {
            Object.Destroy(obj, delay);
            if (lua.Type(1) == LuaTypes.LUA_TUSERDATA)
            {
                MetaMethods.__gc(lua);
            }
        }
        return(0);
    }
 static int Destroy(IntPtr L)
 {
     MetaMethods.__gc(L);
     return(0);
 }