Skip to main content
The editor automatically saves your workspace state between sessions. When you close and reopen the editor, it restores your previous position and level data.

What Is Persisted

How Persistence Works

On Editor Load

  1. LoadPersistentData(true) is called during Start()
  2. Camera position and rotation are restored
  3. Block selector position is restored
  4. If level data exists, the level is rebuilt from it
  5. 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 (OnMainMenuSelectChoice with Quit)
  • Reloading the editor

On Editor Quit

  1. Current level data is built from the editor state
  2. Camera position, rotation, and selector position are saved
  3. Level data and path are saved
  4. 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):
  1. ClearLevel() is called — removes all blocks, items, enemies
  2. LoadPersistentData(false) restores the saved state
  3. If no saved data exists, a new empty level is created