SplitScript reference / UnityScenes / persistent

UnityScenes.persistent

Method

UnityScenes.persistent() -> UnityScene?!

Reads Unity's persistent DontDestroyOnLoad scene.

Unity keeps objects that survive ordinary scene transitions in this special scene. Unity 5.6.0 and 5.6.1 return a successful None because they have no persistent scene. Later players return Some(snapshot); failed reads return an error and retain the preceding state value.

Effects: allocates, reads process memory, requires an attached process

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

Examples

Inspect the persistent scene

state Unity ["game.exe"] {
    persistentScene = unity.scenes.persistent();
}