with one click
unity-scene-management
Unity Scene Management
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Unity Scene Management
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Unity ScriptableObject Architecture
Unity Shaders
Unity State Machines
Registers new C# files in resources/manifests/<system>.json (files array + tests.editmode/playmode list) and validates with just validate-registry. Use when creating any new script, adding a new game system, or fixing 'orphan file' CI failures. Trigger phrases: 'add to manifest', 'register file', 'new system', 'validate registry'. Key capabilities: exact JSON manifest format, ACTIVE/DEPRECATED/EXPERIMENTAL status, dependency declarations, test class name mapping for pre-push gating via resolve_module_tests.py. Do NOT use for modifying physics logic or editing game scripts unrelated to registration.
Unity Terrain & Track Creation for RC Racing
Unity Testing, Debugging & QA
| name | unity-scene-management |
| description | Unity Scene Management |
Use this skill when loading, unloading, or organizing scenes, implementing additive scene architectures, or building scene transition flows in Unity.
Prevents a GameObject from being destroyed when a new scene loads (in Single mode).
public class AudioManager : MonoBehaviour
{
private static AudioManager _instance;
private void Awake()
{
// Singleton guard -- prevents duplicates when returning to a scene
if (_instance != null)
{
Destroy(gameObject);
return;
}
_instance = this;
DontDestroyOnLoad(gameObject);
}
}
Pitfalls:
Scenes must be in File -> Build Settings to be loaded by name or index.
// Check if a scene is in build settings (editor utility)
#if UNITY_EDITOR
public static bool IsSceneInBuild(string sceneName)
{
foreach (var scene in UnityEditor.EditorBuildSettings.scenes)
{
if (scene.enabled && scene.path.Contains(sceneName))
return true;
}
return false;
}
#endif
CI/automation tip: Validate that all referenced scenes are in Build Settings as part of your build validation step. Missing scenes cause runtime errors with no compile-time warning.
Unity supports having multiple scenes open simultaneously in the editor. This is useful for the bootstrapper pattern.
Hierarchy:
_Boot (loaded)
GameBootstrapper
AudioManager
_UI (loaded, additive)
Canvas
EventSystem
Level_01 (loaded, additive, active)
Terrain
Player
Enemies
Editor workflow:
_Boot scene_UI and Level_01 into Hierarchy (or File -> Open Scene Additive)Level_01 -> Set Active SceneGotcha: Objects dragged between scenes in the editor change scene ownership. This can silently break references. Always verify an object's scene in the Inspector header.
| Game Type | Recommended Pattern |
|---|---|
| Simple (1-5 scenes) | LoadSceneAsync with Single mode + loading screen |
| Medium (menu + levels) | Bootstrapper + additive loading |
| Large (open world) | Addressables + streaming + additive loading |
| Prototype / game jam | Synchronous loading is fine |