I have a huge database in my game which doesn’t change often. So, naturally, I want to keep it in memory to speed thngs up rather than getting the whole database deserialized/serialized every time assembly reloading happens in Unity Editor. (Actually, my database is an external file which is loaded manually when the game starts but it would be still better if I can keep it in editor memory and just set the reference to it when I enter play mode).
Is there any way you can keep your non-serialized values/fields after your scripts are compiled in editor?
Hmm, I just tested with10x50MB of scriptable objects and while it takes ages to save/load the scene referencing them, it doesn’t seem to slow down the time it takes to enter/leave play mode and upon assembly reloading. So, I guess in my case it might be better to just use scriptable objects for database rather than storing it externally and loading it manually.
Why is the database so huge? And can you clarify, “loaded manually” what exactly are you loading? I suspect you are referring to large data file, and not a database?
Thanks for the reply. The database is arrays of some data structure and by saying “loaded manually” I meant deserializing manually by using fast serializer like protocol buffer. Anyway, the whole thing is to bypass serialization on domain reload so that I won’t have to wait for 10+secs everytime a script is compiled etc.Scriptable objects seem to survive domain reload so I guess my problem is solved.