08-12-2020, 11:58 PM
As you can read here:
https://docs.unity3d.com/ScriptReference/Resources.html
"Some loaded assets, most notably textures, can use up memory even when no instance exists in the Scene. To reclaim this memory when the asset is no longer needed, you can use Resources.UnloadUnusedAssets."
This is related to only assets loaded via the Resources class, and not ones assigned through the inspector.
Assets loaded by Curvy Splines via the Resources.Load method are not numerous. It loads the CurvyDefaultMaterial material, and the icons for the UI. That's it. So Resources.UnloadUnusedAssets does not do much, since the icons for the UI are referenced for the life time of the Unity session, only CurvyDefaultMaterial is unloaded if not used anymore.
To sum up, I don't believe that commenting that line would be an issue. If it happens to be, please let me know.
Also, do you have a huge number of assets? This is the only explanation I find for Resources.UnloadUnusedAssets to take so much time.
https://docs.unity3d.com/ScriptReference/Resources.html
"Some loaded assets, most notably textures, can use up memory even when no instance exists in the Scene. To reclaim this memory when the asset is no longer needed, you can use Resources.UnloadUnusedAssets."
This is related to only assets loaded via the Resources class, and not ones assigned through the inspector.
Assets loaded by Curvy Splines via the Resources.Load method are not numerous. It loads the CurvyDefaultMaterial material, and the icons for the UI. That's it. So Resources.UnloadUnusedAssets does not do much, since the icons for the UI are referenced for the life time of the Unity session, only CurvyDefaultMaterial is unloaded if not used anymore.
To sum up, I don't believe that commenting that line would be an issue. If it happens to be, please let me know.
Also, do you have a huge number of assets? This is the only explanation I find for Resources.UnloadUnusedAssets to take so much time.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.