Does UnloadUnusedAssets() unload non-active or occlud

Hello!

Does Resources.UnloadUnusedAssets(); unload assets that are simply non-active and/or occluded? The docs don’t mention that specifically, but I’d very much like to know. Thanks!

No, It only unloads assets that have been destroyed. All Unity Object are destroyed via a call to Object.Destroy, passing the Object as an argument. GameObjects are automatically destroyed when unloading a scene unless using doing an additive load. As such, the best time to call it is between scene changes.

That being said, however, I’ve worked on a project where we had to call it manually due to textures loaded via WWW requests sucking up RAM. To handle it at opportune times, I created a static MemoryReclaimer class which would schedule an UnloadUnusedAssets and a System.GC call after destroying the object.