Closed omid3098 closed 6 years ago
Checkout this video to learn more about what's under the hood : https://www.youtube.com/watch?v=6vmRwLYWNRo
ScriptableObjects don't necessarily write to disk all the time - however, I really need to test this in editor. But they do not write to disk at all in builds! See the wiki FAQs for more info.
I had the same experience with normal usage of SOs, they seem they are written to disk in the Editor,but when you make a build,they don't. The good news is that they are supported by the JsonUtility of unity so you can make a Json out of your SOs, and on save, save the json to disk. and in load, load the json and with the "Overwrite" method of the JsonUtility, populate your SOs again.
Ok, just done some tests - changing the value at runtime does not write to or read from the disk! The only time it does is if you click File > Save Project.
Yes you are right, these changes only will be written on disk inside the Editor and when it comes to builds, their initial value will be use on each game startup. So I guess it look safe to use them as in-memory variables.
Hello and thank you for starting this repo. I want to know about reading and writing performance on smart data (generally scriptable objects!) . as their values are being written on disk, is this like reading and writing on textfiles? so should we avoid using them on constantly calling methods like update?