- Изменено
Spine Init Optimization
Hello. There is a problem that has been preventing the release of the game for a month. I have 30 levels which are divided into scenes. In the profiler, I saw that when loading a scene (almost all of it consists of objects with spine animation), a huge amount of memory is allocated. Gradually, as the game progresses, it starts to slow down and by the 25th lvl is no longer playable due to freezes and lags. Perhaps there is a way to make initialization easier or to clear the data after a scene change. I would be grateful for any help
Are you using texture repacking at runtime to create new combined atlas textures? Then you could call the following to free up resources:
AtlasUtilities.ClearCache();
Resources.UnloadUnusedAssets();
In general there should be no steady growth of allocated memory when switching to different scenes when skeleton objects are loaded normally.
If memory grows steadily when only using unchanged skins, could you perhaps share a minimal Unity reproduction project that still shows this issue, then we can have a look at it. You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum URL so that we know the context.