This is a simple, non-optimized way to preview nodes. It works fine for the examples, at least.
Since it's just using load() and creating and destroying the scene whenever you toggle it, it's going to perform worse when the scenes are very intricate. For now, for me, it's fancy enough.
Key points are that the zone's scripts (saying "zone01 ready") only run in-game, as they aren't tools, and saving the scenes with previews enabled does not include the preview nodes, just the flag used to set it in editor. So when you open the game, it's behaving exactly as before.
This is a simple, non-optimized way to preview nodes. It works fine for the examples, at least.
Since it's just using
load()
and creating and destroying the scene whenever you toggle it, it's going to perform worse when the scenes are very intricate. For now, for me, it's fancy enough.Key points are that the zone's scripts (saying "zone01 ready") only run in-game, as they aren't tools, and saving the scenes with previews enabled does not include the preview nodes, just the flag used to set it in editor. So when you open the game, it's behaving exactly as before.