Hello,
I’m trying to figure out the best practice for unloading a Prefab that has been dynamically loaded in via Resource.Load.
As it’s an entire GameObject, I can’t just call:
Resources.UnloadAsset(myPrefab);
As that just won’t work as it needs to be specifically an Asset of sorts. Also, I don’t want to use ‘UnloadUnusedAssets’ as this actually triggers a bug in my app (it removes textures that are in actual fact being used - thus leaving a black texture - iOS).
Would I cycle through all child objects, and pick out any assets, and call ‘UnloadAsset’ on that? Also, I know that I need to destroy the gameObject first, but if I do how do I then call ‘UnloadAsset’ on it? As the reference won’t exist anymore, right?
Whats the best way to achieve this? Thanks.