Ejemplo n.º 1
0
    /// <summary>
    /// 卸载单个资源
    /// </summary>
    public void UnLoadOneAsset(string assetname, AssetType assetType = AssetType.HoldOnAsset)
    {
        bool      ishave    = false;
        AssetFile assetfile = null;

        switch (assetType)
        {
        case AssetType.HoldOnAsset:
            ishave = holdonFile.TryGetValue(assetname, out assetfile);
            break;

        case AssetType.UIAsset:
            ishave = uiFile.TryGetValue(assetname, out assetfile);
            break;

        case AssetType.BattleAsset:
            ishave = battleFile.TryGetValue(assetname, out assetfile);
            break;
        }

        if (ishave)
        {
            assetfile.UnLoadBundle();
            //TODO 确实卸载当前这个资源 不应该卸载相关的所有资源
            //assetfile.Destory();
        }
    }