Exemplo n.º 1
0
    public static int UnloadBundle(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 1 && LuaScriptMgr.CheckTypes(L, 1, typeof(string)))
        {
            var bundleName = LuaScriptMgr.GetString(L, 1);
            CAssetBundleManager.UnloadBundle(bundleName);
        }

        return(CheckReturnNum(L, count, nRet));
    }
Exemplo n.º 2
0
    public void Clear()
    {
        _BeginFrameUpdate          = false;
        _BlocksRootTran            = null;
        _PlayerLightmapBundleAsset = null;

        _SceneLightmapDatas        = null;
        LightmapSettings.lightmaps = null;

        _LoadedAQUASReflectionDic.Clear();
        _LoadedStaticObjectAudioDic.Clear();
        _LoadedPoints.Clear();

        _CurSceneGuid = 0;

        foreach (var kv in _LoadedObjectDic)
        {
            if (null != kv.Value)
            {
                GameObject.Destroy(kv.Value);
            }
        }
        _LoadedObjectDic.Clear();

        foreach (var kv in _ObjectCacheDic)
        {
            if (null != kv.Value)
            {
                GameObject.Destroy(kv.Value);
            }
        }
        _ObjectCacheDic.Clear();

        _LightmapIdx2RefCountDic.Clear();

        _BeginFrameUpdate    = false;
        _CallBack            = null;
        _PreLoadBlockCounter = 0;

        _IsLightmapsUpdated = false;

        if (_Config != null && !string.IsNullOrEmpty(_Config.BundleName))
        {
            CAssetBundleManager.UnloadBundle(_Config.BundleName);
        }

        _Config = null;
    }