A lightweight Unity Editor utility that automatically loads a designated startup scene when entering Play Mode and restores your previously opened scene setup when exiting Play Mode.
Perfect for projects that always need to start from a Loading Scene, Bootstrap Scene, Initialization Scene, or Main Menu scene during testing.
In larger Unity projects, gameplay scenes often depend on systems initialized by a bootstrap scene:
- Save Systems
- Audio Managers
- Dependency Injection
- Addressables Initialization
- Analytics
- Localization
- Loading Screens
Opening a gameplay scene directly and pressing Play can cause missing references, initialization issues, or inconsistent behavior.
This tool solves that problem by automatically:
- Saving your currently opened scenes.
- Opening your designated startup scene.
- Entering Play Mode.
- Restoring your original scene setup when Play Mode ends.
- Automatically loads a startup scene before Play Mode.
- Restores previously opened scenes after Play Mode.
- Supports multiple open scenes.
- Optional "Save Before Play".
- Project-specific settings.
- No runtime dependencies.
- No packages required.
- Works entirely inside the Unity Editor.
Place the script inside:
Assets/Editor/
Example:
Assets/Editor/PlayModeLoader.cs
Add this repository as a Git submodule inside your project's Editor folder.
Open:
Edit → Project Settings → Play Mode Loader
Configure:
- Enable Loader
- Save Before Play
- Loading Scene Path
Select the scene that should always be loaded before entering Play Mode.
Example:
Assets/Scenes/Loading.unity
Suppose you are currently editing:
- Level_05
- LightingScene
- UIScene
When you press Play:
Level_05 LightingScene UIScene
↓
Loading
↓
Play Mode
When you stop Play Mode:
Loading
↓
Level_05 LightingScene UIScene
Your original scene setup is restored automatically.
Always start from:
Assets/Scenes/Bootstrap.unity
Always start from:
Assets/Scenes/Loading.unity
Always start from:
Assets/Scenes/MainMenu.unity
- Unity 2021+
- Editor-only
MIT License