How can I unload a single resource?

I can use Resources.Load(path) to load a single resource file. How can I unload it?

  • Object.Destroy says I can't destroy an asset

  • Object.DestroyImmediate destroys the resource, and the underlying asset, and requires me to re-import in the editor (surprise!)

  • Resources.UnloadUnusedAssets doesn't let me pick which resource to unload

Should I just use UnloadUnusedAssets anyway?

A new method has been added in Unity 3.5.2 that should do what you are after:

Resources.UnloadAsset(Object asset);