s&box docs

public class Sandbox.PrefabFile : Sandbox.GameResource

A GameObject which is saved to a file.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

Methods

Showing 7 methods

protected virtual Sandbox.Bitmap CreateAssetTypeIcon(int width, int height)

public string GetMetadata(string title, string defaultValue = null)

Read metadata saved using a ISceneMetadata based component, such as SceneInformation

Parameters

  • defaultValue: Default: null

public Sandbox.PrefabScene GetScene()

Get the actual scene scene

public static Sandbox.PrefabFile Load(string path)

Load a prefab by file path. Also handles mount:// paths

protected virtual void OnDestroy()

protected virtual void PostLoad()

protected virtual void PostReload()

Properties

Showing 8 properties

protected virtual object Sandbox.PrefabFile.ActionGraphTarget { get; set; }

protected virtual System.Type Sandbox.PrefabFile.ActionGraphTargetType { get; set; }

public bool Sandbox.PrefabFile.DontBreakAsTemplate { get; set; }

If true then the prefab will not be broken when created as a template

Icon to show to the left of the option in the menu

If ShowInMenu is true, this is the path in the menu for this prefab

public virtual int Sandbox.PrefabFile.ResourceVersion { get; set; }

public System.Text.Json.Nodes.JsonObject Sandbox.PrefabFile.RootObject { get; set; }

Contains the original JSON read from File.

public bool Sandbox.PrefabFile.ShowInMenu { get; set; }

If true then we'll show this in the right click menu, so people can create it

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.PrefabFile

On this page