Api Sandbox Mounting PrefabBuilder
class

PrefabBuilder

public sealed class PrefabBuilder

A scoped builder for creating prefabs within a Mount. Typically used inside a Load implementation.

Constructors

PrefabBuilder()

Methods

PrefabBuilder WithName(String name)

Set the name/resource path of the resulting prefab. The root GameObject name is derived from the filename portion if left unchanged.

PrefabBuildScope Scope()

Enter a temporary scene scope. GameObjects created inside will become part of this prefab.

PrefabFile Create()

Serialize the scene content into a registered PrefabFile. Call after you've created any objects and the Scope has been disposed.

static Void Destroy(PrefabFile prefab)

Unregister and destroy a PrefabFile created by Create. Call from Shutdown when a mount is disabled.

Assembly: Sandbox.Engine Namespace: Sandbox.Mounting Full Name: Sandbox.Mounting.PrefabBuilder