I found OnFontAssetRequest and OnSpriteAssetRequest can be used to load resources by our custom ResourceManager. But I found MaterialReferenceManager hold the loaded resources and never release the references.
I think TMP should provide a way to clear the references manually (and clearing when the scene is unloaded may be also useful). I saw there is a Clear() method in MaterialReferenceManager, but commented, does it cause some issues?
Thanks for the reply.
I did a test for TMP_ResourceManager.RemoveFontAsset(), but it seems it’s not enough to unload TMP_FontAsset. Also, TMP_SpriteAsset is not unloaded.
I need to use the following code before loading a new scene to make sure TMP_FontAsset and TMP_SpriteAsset not be referenced:
After applying the code above, Memory Profiler reports a TMP_FontAsset and a TMP_SpriteAsset are unused assets(Before, they are referenced by some static variables). But it’s strange that they are can’t be unloaded using Resources.UnloadUnusedAssets.