There are two problems that confuse me.
-
In SceneLoading project, I set a custom material to spheres to check ref count in the profiler.When loading spheres,the ref count goes to 4,and there is no ref count after unloading the scene.But it don’t clear unused assets until I call Resources.UnloadUnusedAssets() in code manually.This obviously differ to the document which said “Once a given asset’s ref-count is at zero, it will be unloaded.”
Here are the screenshots.
Imgur: The magic of the Internet
Imgur: The magic of the Internet -
In my own project ,When I initiate one prefab,which has been set a custom material,its ref count goes to 2,amazing me a lot. I tried Addressables.Release()/ReleaseInstance(),but they both decrease ref count by 1,there is still ref count of 1.
Imgur: The magic of the Internet
Imgur: The magic of the Internet
Imgur: The magic of the Internet