Stable Scene Reference
Automatically generate stable ScriptableObject references to your Build Settings scenes with GUID-based tracking. Scene references update dynamically when scenes are renamed or moved, and persist across project changes without manual setup. Includes convenient utility methods for loading and unloading scenes directly from references.
com.gilzoide.stable-scene-reference 
Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/stable-scene-reference.git README Markdown
Copy this to your project's README.md
## Installation
Add **Stable Scene Reference** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/stable-scene-reference.git
```
[](https://www.pkglnk.dev/pkg/stable-scene-reference)Dependencies (1)
README
Stable Scene Reference
Autogenerated ScriptableObjects that are stable references to the scenes configured in Unity Build Settings.
Features
- Scene references are automatically generated/refreshed whenever the scenes in Build Settings change or any scene is renamed/moved, no code or manual setup required
- Scene references are stable and based on their GUID: if a scene is renamed/moved, all existing references to the corresponding
SceneReferenceare maintained - No extra files are created in your project: everything lives in the asset imported from an empty file that lives in the package's own folder
- Utility methods
SceneReference.Load,SceneReference.LoadAsyncandSceneReference.UnloadAsyncto load/unload scenes directly from references
Caveats
- Only Scenes enabled in Build Settings are generated
- Referencing scenes that are not in Build Settings is not supported at all
- If you have multiple build configurations that involve changing which Scenes are enabled, previous references to disabled ones will be missing from the build and will be
nullat runtime
How to install
Either:
- Use the openupm registry and install this package using the openupm-cli:
openupm add com.gilzoide.stable-scene-reference - Install via Unity Package Manager using the following URL:
https://github.com/gilzoide/unity-scene-reference.git#1.0.0 - Clone this repository or download a snapshot of it directly inside your project's
AssetsorPackagesfolder.
How to use
- Declare SceneReference fields in your scripts
- Use the Inspector to assign any of the
SceneReferences automatically generated from your project's Build Settings - Use
SceneReference.Load,SceneReference.LoadAsyncandSceneReference.UnloadAsyncto load/unload scenes. Alternatively, useSceneReference.BuildIndexorSceneReference.Pathas argument to SceneManager load/unload methods. - Enjoy 🍾
No comments yet. Be the first!