Plush

SceneBoxes#

PlushEngine · Type index

Namespace: PlushEngine

Boxes (.box) the game loads while it runs: new objects, effects and sounds, by library path. A Box stays loaded for the rest of the play session, in every scene, until it is unloaded. Blocks it shares with the game (or an earlier Box) by ID and identity are the game's own: nothing is loaded twice. A block under the same ID with different content refuses the Box.

public sealed class SceneBoxes

Members: Available · Blocks · KeptBlocks · Load · Loaded · Unload

Available#

public IReadOnlyList<AvailableBox> Available { get; }

The Boxes in the game's content folders, one per Box (its newest version): shipped with the game, installed beside it (such as Steam DLC) or downloaded to the player's folder. Read from the Boxes' records; nothing is loaded. In editor Play these are the Boxes this project builds and its remembered Box store.

Blocks#

public int Blocks { get; }

Blocks (images, meshes, materials, sounds and the like) the game and the loaded Boxes hold in this scene, shared by ID and identity, plus those kept: no longer provided by anything loaded but still used by an object.

KeptBlocks#

public int KeptBlocks { get; }

Blocks an unloaded Box provided that objects in this scene still use, such as an object the game gave a Box's material. They stay until nothing uses them; loading the Box again shares them instead of loading copies.

Load#

public LoadedBox Load(AvailableBox box);

Loads a Box listed by Available.

public LoadedBox Load(string nameOrPath);

Loads a Box and adds its library items to Scene.Library. Name the Box ("KitProps") to load its newest version from the game's content folders (Available); a relative path ("DLC/KitProps.box") is looked up under those folders, never the folder the game was started from. A thin Box, one added to a Box store, reads the rest of its content from its store and the game's other stores. Throws when no such Box exists, the Box was made for another engine, needs a script the game does not have, or holds a block that differs from the game's, a loaded Box's or a kept block's under the same ID. Signed Boxes are authenticated against the game's trusted keys and every payload is verified before changing scene state. Shipping games refuse unsigned Boxes; editor Play and explicitly development exports allow unsigned content with a log note, but never invalid signed content. Already-loaded Boxes are checked against policy again before return.

Loaded#

public IReadOnlyList<LoadedBox> Loaded { get; }

The Boxes loaded in this play session, in load order.

Unload#

public void Unload(LoadedBox box);

Unloads a Box: objects spawned from items only it provided are destroyed, and its library items, effects, sounds and sequences leave the catalogs. Blocks the game or another loaded Box holds stay; the rest is freed, on the GPU too, except blocks a remaining object still uses: those are kept (KeptBlocks) until nothing does. Effects and sounds already playing finish. Unloading a Box that is not loaded does nothing.

AvailableBox · LoadedBox

Source#