s&box docs

public static abstract sealed class Editor.EditorUtility.Prefabs

Broader workflow and conceptual references connected to this API.

Methods

Showing 22 methods

public static void AddInstanceAddedGameObjectToPrefab(Sandbox.GameObject go)

`PrefabInstanceData.AddGameObjectToPrefab(Sandbox.GameObject)`

public static void ApplyComponentInstanceChangesToPrefab(Sandbox.Component comp)

`PrefabInstanceData.ApplyComponentChangesToPrefab(Sandbox.Component)`

public static void ApplyGameObjectInstanceChangesToPrefab(Sandbox.GameObject go)

`PrefabInstanceData.ApplyGameObjectChangesToPrefab(Sandbox.GameObject)`

public static void ApplyPropertyChange(Sandbox.SerializedProperty prop)

`PrefabInstanceData.ApplyPropertyChangeToPrefab(System.Object,System.String)`

public static void ConvertGameObjectToPrefab(Sandbox.GameObject go, string saveLocation, bool skipDiskWrite = False)

Convert a GameObject to a prefab. This will write the newly created prefab to disk and set the prefab source on the GameObject.

Parameters

  • skipDiskWrite: Default: False

public static Sandbox.PrefabFile CreateAsset(Sandbox.GameObject clone)Obsolete

Create a prefab out of any GameObject

Obsolete: This API member is obsolete.

public static string GetOuterMostPrefabName(object obj)

Returns the name of the prefab file that this GameObject or Component is an instance of.

public static Sandbox.SerializedProperty GetTargets(Sandbox.GameObject root, Sandbox.PrefabVariable variable)Obsolete

Get a SerializedProperty representing variable targets. Will return null if there are no targets

Obsolete: This API member is obsolete.

public static System.Collections.Generic.IEnumerable`1<Sandbox.PrefabFile> GetTemplates()

Fetches all prefab templates to show in Create GameObject menus

public static bool IsComponentAddedToInstance(Sandbox.Component comp)

`PrefabInstanceData.IsAddedComponent(Sandbox.Component)`

public static bool IsComponentInstanceModified(Sandbox.Component comp)

`PrefabInstanceData.IsComponentModified(Sandbox.Component)`

public static bool IsComponentPartOfInstance(Sandbox.Component comp)

Returns true if the owning GameObject is part of a prefab instance.

public static bool IsGameObjectAddedToInstance(Sandbox.GameObject go)

`PrefabInstanceData.IsAddedGameObject(Sandbox.GameObject)`

public static bool IsGameObjectInstanceModified(Sandbox.GameObject go)

`PrefabInstanceData.IsGameObjectModified(Sandbox.GameObject,System.Boolean)`

public static bool IsInstanceModified(Sandbox.GameObject prefabInstance)

`PrefabInstanceData.IsModified`

public static bool IsOuterMostPrefabRoot(object obj)

Returns the name of the prefab file that this GameObject or Component is an instance of.

public static bool IsPropertyOverridden(Sandbox.SerializedProperty prop)

`PrefabInstanceData.IsPropertyOverridden(System.Object,System.String,System.Boolean)`

public static void RevertComponentInstanceChanges(Sandbox.Component comp)

`PrefabInstanceData.RevertComponentChanges(Sandbox.Component)`

public static void RevertGameObjectInstanceChanges(Sandbox.GameObject go)

`PrefabInstanceData.RevertGameObjectChanges(Sandbox.GameObject)`

public static void RevertPropertyChange(Sandbox.SerializedProperty prop)

`PrefabInstanceData.RevertPropertyChange(System.Object,System.String)`

public static void WriteInstanceToPrefab(Sandbox.GameObject go, bool skipDiskWrite = False)

Write a prefab instance back to the prefab file and save it to disk.

Parameters

  • skipDiskWrite: Default: False

Metadata

FieldValue
Namespaceglobal
Typeclass
AssemblySandbox.Tools
Doc IDT:Editor.EditorUtility.Prefabs

On this page

Methodspublic static System.Void AddInstanceAddedGameObjectToPrefab(Sandbox.GameObject go)public static System.Void ApplyComponentInstanceChangesToPrefab(Sandbox.Component comp)public static System.Void ApplyGameObjectInstanceChangesToPrefab(Sandbox.GameObject go)public static System.Void ApplyPropertyChange(Sandbox.SerializedProperty prop)public static System.Void ConvertGameObjectToPrefab(Sandbox.GameObject go, System.String saveLocation, System.Boolean skipDiskWrite = False)public static Sandbox.PrefabFile CreateAsset(Sandbox.GameObject clone)public static System.String GetOuterMostPrefabName(System.Object obj)public static Sandbox.SerializedProperty GetTargets(Sandbox.GameObject root, Sandbox.PrefabVariable variable)public static System.Collections.Generic.IEnumerable`1<Sandbox.PrefabFile> GetTemplates()public static Sandbox.PrefabScene.VariableCollection GetVariables(Sandbox.SerializedObject obj)public static System.Boolean IsComponentAddedToInstance(Sandbox.Component comp)public static System.Boolean IsComponentInstanceModified(Sandbox.Component comp)public static System.Boolean IsComponentPartOfInstance(Sandbox.Component comp)public static System.Boolean IsGameObjectAddedToInstance(Sandbox.GameObject go)public static System.Boolean IsGameObjectInstanceModified(Sandbox.GameObject go)public static System.Boolean IsInstanceModified(Sandbox.GameObject prefabInstance)public static System.Boolean IsOuterMostPrefabRoot(System.Object obj)public static System.Boolean IsPropertyOverridden(Sandbox.SerializedProperty prop)public static System.Void RevertComponentInstanceChanges(Sandbox.Component comp)public static System.Void RevertGameObjectInstanceChanges(Sandbox.GameObject go)public static System.Void RevertPropertyChange(Sandbox.SerializedProperty prop)public static System.Void WriteInstanceToPrefab(Sandbox.GameObject go, System.Boolean skipDiskWrite = False)Metadata