SplitScript reference / UnityScenes / loaded

UnityScenes.loaded

Method

UnityScenes.loaded() -> [UnityScene]!

Reads every currently loaded scene as one immutable array.

Scene order matches Unity's native loaded-scene table. The operation is all-or-nothing: an invalid table entry or failed scene component read returns an error instead of exposing a misleading partial collection.

Effects: allocates, mutates the receiver, reads process memory, requires an attached process

Runtime behavior: available while a process is attached, except in onDetach; synchronous

Examples

Compare the active scene with Unity's first loaded scene

isLoading {
    if current.loadedScenes.isEmpty() {
        return None
    }
    let first = current.loadedScenes[0]
    return current.activeScene.name != first.name
}