Unloading an asset loaded via Resources.LoadAsync

If I try to use Resources.UnloadAsset() to unload a prefab that was loaded with a call to Resources.LoadAsync(), I get the following error:

UnloadAsset may only be used on individual assets and can not be used on GameObject’s / Components or AssetBundles

Is there another way to do this? Is it not possibly to unload an asynchronously loaded prefab? Is this perhaps a bug with the new Resources.LoadAsync() method?

The prefab itsself isn’t the actual resource, it’s the assets that it depends on. The best way to unload something is to first ensure there are no references to it by setting any to null. Then call Resources.UnloadUnusedAssets. Trying to unload it directly is more tricky than it’s worth.

You may also try Destroying your gameobject instead of trying to unload it.This will set any references it has to null.