//---------------------------------------------------------------------------- private void UnloadAudioAsset(string strAssetID, AssetCube cube) { AudioClip clip = cube.objAsset as AudioClip; AssetBundle bundle = null; if (clip.loadType == AudioClipLoadType.Streaming) { if (m_dictStreamedAsset.TryGetValue(strAssetID, out bundle)) { if (bundle != null) { bundle.Unload(true); } m_dictStreamedAsset.Remove(strAssetID); } } else { Resources.UnloadAsset(cube.objAsset); } }
//------------------------------------------------------------------------ private void UnLoadAsset(string strAssetID, AssetCube cube) { switch (cube.typeAsset) { case EAssetType.eGameObject: case EAssetType.eAtlas: Object.DestroyImmediate(cube.objAsset, true); break; case EAssetType.eObject: case EAssetType.eTexture: Resources.UnloadAsset(cube.objAsset); break; case EAssetType.eAudio: UnloadAudioAsset(strAssetID, cube); break; default: break; } }