A important thing that I did't notice before. AtlasReplacement script must hold the reference for all loaded resources and use DontDestroyOnLoad. If not, the unity3d could clean up during a scene transiction.
But that way all atlases are loaded into memory at all times.
I would like to have only atlases that are used on the current scene loaded into memory.
Is there a way to not lose the reference to SD/HD atlas in the reference atlas?
I have all - SD, HD and reference atlases prefabs in the Resources folder.
At app launch Im loading all reference atlases and setting the reference to SD or HD atlas (that I also load from Resources).
At first scene everything is ok, but after going to different scene I have default (SD) atlases referenced (default setting in the reference atlases) - as if the reference to HD wasnt remembered. It makes sense but some time ago (few versions of Unity ago) it worked fine.
Do I have to load all atlases and set HD references on each scene change?
I think in the end it would mean the same thing as having all atlases loaded all the time.Regards, Marcin.
EDIT:
Im doing just that - loading all reference atlases and setting HD atlas if needed.
Its fine because its just prefab references, texture of the atlas is not loaded.
And then - on newly loaded scene - only if particular reference atlas is used the texture (SD or HD) will be loaded.
I think its how it should be.
What You think?