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".
- Startup scene is selected from Build Settings, so renaming or moving the scene file never breaks the reference.
- 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.
- Add your startup scene to File → Build Settings (it must appear in the Scenes In Build list).
- Open:
Edit → Project Settings → Play Mode Loader
- Configure:
- Enable Loader
- Save Before Play
- Loading Scene (a dropdown listing every scene currently in Build Settings)
Select the scene that should always be loaded before entering Play Mode.
Example:
Assets/Scenes/Loading.unity
Since the loader references scenes by their Build Settings index rather than a file path, you can freely rename or move the scene afterward without needing to reselect it. If you reorder the Scenes In Build list, double check the dropdown still points at the scene you expect.
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
- Startup scene must be added to File → Build Settings
MIT License