What Is Persisted
How Persistence Works
On Editor Load
LoadPersistentData(true)is called duringStart()- Camera position and rotation are restored
- Block selector position is restored
- If level data exists, the level is rebuilt from it
- The best editor time is restored
During Editing
State is not continuously saved — it is saved explicitly when:- Testing the level (
TestCurrentLevel) - Quitting the editor (
OnMainMenuSelectChoicewithQuit) - Reloading the editor
On Editor Quit
- Current level data is built from the editor state
- Camera position, rotation, and selector position are saved
- Level data and path are saved
- The state persists until the next editor session
Static Storage
EditorPersistentState is a static class — its data persists across scene loads within the same application session. However, data is lost when the application is closed.
The persistent state is not the same as saving a level file. Persistent state is session-only. To permanently save your work, use the Save menu.
Reload Behavior
When the editor reloads (e.g., after testing or switching sections):ClearLevel()is called — removes all blocks, items, enemiesLoadPersistentData(false)restores the saved state- If no saved data exists, a new empty level is created