Prowl organises all liveDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt
Use this file to discover all available pages before exploring further.
GameObjects into a single active Scene. The static SceneManager class owns that scene, drives the per-frame update/physics/render loop, and provides helpers for loading, unloading, and snapshotting scenes. Understanding the scene lifecycle is essential whether you are writing runtime gameplay code, building editor tooling, or handling play-mode transitions.
The Scene object
Scene extends EngineObject and is serialised as a first-class asset (file extension .prowl). It holds:
| Member | Purpose |
|---|---|
AllObjects | All non-destroyed GameObjects registered in the scene |
ActiveObjects | Objects that are non-destroyed and enabledInHierarchy |
RootObjects | Top-level objects with no parent |
SaveableObjects | Objects not marked with HideFlags.DontSave or HideFlags.HideAndDontSave |
Count | Total number of registered objects |
Fog | FogParams struct (mode, colour, density) |
Ambient | AmbientLightParams struct (uniform or hemisphere lighting) |
FogParams
FogMode enum includes Off, Linear, Exponential, and ExponentialSquared. For Linear mode, Start and End distances are exposed.
AmbientLightParams
SceneManager — the static controller
SceneManager (namespace Prowl.Runtime.SceneManagement) is the central hub for scene operations.
Loading a scene
LoadScene calls Clear() on the current scene, sets the new scene as Current, resolves prefab links with HandlePrefabs(), invokes OnSceneLoadAttribute callbacks, and then calls OnLevelWasLoaded() on every active MonoBehaviour.
Creating a blank scene
Clearing the scene
Clear() triggers OnSceneUnloadAttribute callbacks and correctly resets Camera.Main before disposal.
The update/render loop
Each frame the engine calls three methods onSceneManager:
SceneManager.Update()
Iterates all active
GameObjects and:- Calls
PreUpdate()— runsAwake()andStart()on any component that hasn’t awoken/started yet. - Runs the physics simulation (play mode only).
- Calls
Update()and advances coroutines for every enabledMonoBehaviour. - Calls
LateUpdate()on every enabledMonoBehaviour. - Advances end-of-frame coroutines.
SceneManager.PhysicsUpdate()
Called on a fixed timestep. Iterates active
GameObjects and calls FixedUpdate() plus fixed-update coroutines on each enabled MonoBehaviour.ForeachComponent utility
SceneManager.ForeachComponent is a public helper used internally by the engine — and usable from your own systems — to iterate all enabledInHierarchy components across a set of GameObjects:
Play mode: StoreScene and RestoreScene
The editor uses a snapshot mechanism so play mode changes do not permanently modify your scene data.RestoreScene deserialises the stored EchoObject snapshot into a fresh Scene, re-applies prefab links, and fires OnSceneLoadAttribute callbacks so engine systems re-initialise correctly.
Manually managing scene contents
You can add and removeGameObjects from any Scene directly:
OnSceneLoad and OnSceneUnload callbacks
Static methods decorated with[OnSceneLoad] or [OnSceneUnload] are automatically discovered and invoked by SceneManager at the appropriate moment:
order integer to control invocation sequence across multiple callbacks.
Scene serialisation
Scene implements ISerializationCallbackReceiver. Before serialisation it flattens AllObjects into a GameObject[]; after deserialisation it re-registers each object via Add() so parent-child relationships are reconstructed correctly. The serialisation format is Prowl’s own Echo tag format (human-readable text by default).
Only
SaveableObjects are written; GameObjects with HideFlags.DontSave or HideFlags.HideAndDontSave are excluded automatically.