API ReferenceSandbox
PrefabFileclass
A GameObject which is saved to a file.
Constructors1
Showing 1 constructors
public PrefabFile()
No results match this filter.
Methods7
Showing 7 methods
protected virtual Sandbox.Bitmap CreateAssetTypeIcon(int width, int height)
| Parameter | Type | Description |
|---|---|---|
| width | int | — |
| height | int | — |
public string GetMetadata(string title, string defaultValue = null)
Read metadata saved using a ISceneMetadata based component, such as SceneInformation
| Parameter | Type | Description |
|---|---|---|
| title | string | — |
| defaultValue = null | string | — |
Returns:
string—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
| Parameter | Type | Description |
|---|---|---|
| path | string | — |
protected virtual void OnDestroy()
Returns:
void—protected virtual void PostLoad()
Returns:
void—protected virtual void PostReload()
Returns:
void—No results match this filter.
Properties8
Showing 8 properties
protected virtual object Sandbox.PrefabFile.ActionGraphTarget { get; set; }
Returns:
object—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
Returns:
bool—public string Sandbox.PrefabFile.MenuIcon { get; set; }
Icon to show to the left of the option in the menu
Returns:
string—public string Sandbox.PrefabFile.MenuPath { get; set; }
If ShowInMenu is true, this is the path in the menu for this prefab
Returns:
string—public virtual int Sandbox.PrefabFile.ResourceVersion { get; set; }
Returns:
int—public System.Text.Json.Nodes.JsonObject Sandbox.PrefabFile.RootObject { get; set; }
Contains the original JSON read from File.
Returns:
JsonObject—public bool Sandbox.PrefabFile.ShowInMenu { get; set; }
If true then we'll show this in the right click menu, so people can create it
Returns:
bool—No results match this filter.