SceneRef - Unity
January 10, 2026•394 words
Unity SceneRef
Welcome to this article, where I will present a simple way to have scene references directly as a property in Unity.
The GitLab snippet with the code is right here.
SceneRef is a struct that contains the build index Unity uses to load a scene, which is more optimized at runtime. The GUID is kept as a string only for the editor, to keep track of the scene asset. Using a GUID allows the reference to persist even if the asset is renamed, moved, or deleted.
Keeping the index of a...
Read post