Editor

Editor tooling for the SceneManagement system. Provides a SceneGraph editor integrated into Unity's Project Settings, custom Inspector drawers for Scene and SceneNode types, a build processor that injects the SceneGraph into builds, and an internal proxy for Unity's hierarchy window.

Architecture

spinner

Data Flow

spinner

Key Concepts

Concept
Description

SceneGraph as ProjectSettings

The SceneGraph asset lives in ProjectSettings/SceneGraph.asset, not as a regular asset. Accessed via EditorSceneManager.GetSceneGraph()

Auto-sync to Build Settings

SceneGraphEditor detects changes and auto-syncs EditorBuildSettings.scenes on every Inspector repaint

Circular dependency detection

SceneGraphEditor validates the graph for cycles on every repaint. If found, Build Settings are cleared on editor close

Build injection

SceneGraphBuildProcessor copies the asset into Assets/Build/Resources/ before build and restores preloaded assets after

Play mode start scene

EditorSceneManager sets the "Main" scene as playModeStartScene and restores the last active scene after entering play mode

Files

File
Description

Sealed editor extension of SceneManager with scene open/close, asset persistence, and build settings sync

Odin property drawer that renders Scene as a read-only SceneAsset field

Build pre/post processor that injects SceneGraph into builds as a preloaded asset

Custom OdinEditor for SceneGraph with circular dependency detection and auto Build Settings sync

Odin property drawer for SceneNode with dependency management UI

Popup scene picker using Odin's GenericSelector for adding scenes and dependencies

Internal Unity API proxies

See Also

  • SceneManager — Runtime base class for scene loading/unloading

  • SceneGraph — Runtime ScriptableObject containing all scene nodes

  • SceneNode — Node representing a scene with its dependencies

  • Scene — Serializable class wrapping Unity scene references

Last updated