AssetBundleFramework.AssetLoader.UnloadAsset C# (CSharp) Метод

UnloadAsset() публичный Метод

卸载指定的Asset资源
public UnloadAsset ( Object asset ) : bool
asset UnityEngine.Object 要卸载的资源
Результат bool
        public bool UnloadAsset(Object asset) {
            if (asset != null) {// 判定传入的asset是否为空
                Resources.UnloadAsset(asset); // 卸载此Asset资源
                return true;
            }

            // 释放Asset资源失败
            Debug.LogError($"{GetType()}/UnlLoadAsset方法传入的参数asset=null,无法卸载空资源");
            return false;
        }

Usage Example

 public void UnloadAsset(UnityEngine.Object asset)
 {
     if (assetLoader != null)
     {
         assetLoader.UnloadAsset(asset);
     }
 }
All Usage Examples Of AssetBundleFramework.AssetLoader::UnloadAsset