/// <summary> /// 卸载资源 / Assetbundle /// </summary> /// <param name="assetPath"></param> /// <param name="isForceUnload"></param> /// <param name="type">带具体类型,有些项目喜欢用重名资源,如a.prefab、a.mat,此时卸载就需要指定类型</param> public static void UnloadAsset(string assetPath, bool isForceUnload = false, Type type = null) { if (string.IsNullOrEmpty(assetPath)) { return; } ResLoader.UnloadAsset(assetPath, isForceUnload, type); }
/// <summary> /// 卸载某个gameobj /// </summary> /// <param name="o"></param> public static void UnloadAsset(string path, bool isForceUnload = false) { if (string.IsNullOrEmpty(path)) { return; } ResLoader.UnloadAsset(path, isForceUnload); }