Page 2 of 2

Re: Programming Question

Posted: Fri Aug 25, 2017 2:24 am
by LorrMaster42
So would it make sense for me to have a special scene for holding all the dungeon data I want to save, then?

Re: Programming Question

Posted: Fri Aug 25, 2017 3:22 am
by Interkarma
Try it both ways. :) Make a small test EditorWindow with some basic data and try storing data to an object (or objects) in the scene. Then try a basic JSON serialization setup. See which way you like, and what will work best for your project.

If you just want things to be as easy as possible, store your persistent data on GameObjects in the scene and make script members public. Unity will then save/load your data with the scene. Your EditorWindow is just a client tool used to modify that data. This is ideal for when your EditorWindow is intended to control some GameObject(s) in the scene.

If you want complete control, roll your own serialization with JSON and store those files in the Asset Hierarchy or elsewhere on the drive (e.g. persistent data path). This can make your EditorWindow work like a totally self-contained application that just happens to run inside Unity. This is ideal when your EditorWindow never cares about what's in the scene.