Prefabsclass

objectPrefabs
Namespace
global
Assembly
Sandbox.Tools
Declaration
public static abstract sealed class Editor.EditorUtility.Prefabs

Methods22

Showing 22 methods

public static void AddInstanceAddedGameObjectToPrefab(Sandbox.GameObject go)PUBLICSTATIC

`PrefabInstanceData.AddGameObjectToPrefab(Sandbox.GameObject)`

ParameterTypeDescription
goGameObject
Returns:void

public static void ApplyComponentInstanceChangesToPrefab(Sandbox.Component comp)PUBLICSTATIC

`PrefabInstanceData.ApplyComponentChangesToPrefab(Sandbox.Component)`

ParameterTypeDescription
compComponent
Returns:void

public static void ApplyGameObjectInstanceChangesToPrefab(Sandbox.GameObject go)PUBLICSTATIC

`PrefabInstanceData.ApplyGameObjectChangesToPrefab(Sandbox.GameObject)`

ParameterTypeDescription
goGameObject
Returns:void

public static void ApplyPropertyChange(Sandbox.SerializedProperty prop)PUBLICSTATIC

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

ParameterTypeDescription
propSerializedProperty
Returns:void

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

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

ParameterTypeDescription
goGameObject
saveLocationstring
skipDiskWrite = Falsebool
Returns:void

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

Create a prefab out of any GameObject

Obsolete: This API member is obsolete.

ParameterTypeDescription
cloneGameObject
Returns:PrefabFile

public static string GetOuterMostPrefabName(object obj)PUBLICSTATIC

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

ParameterTypeDescription
objobject
Returns:string

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

Fetches all prefab templates to show in Create GameObject menus

Returns:IEnumerable<PrefabFile>

public static bool IsComponentAddedToInstance(Sandbox.Component comp)PUBLICSTATIC

`PrefabInstanceData.IsAddedComponent(Sandbox.Component)`

ParameterTypeDescription
compComponent
Returns:bool

public static bool IsComponentInstanceModified(Sandbox.Component comp)PUBLICSTATIC

`PrefabInstanceData.IsComponentModified(Sandbox.Component)`

ParameterTypeDescription
compComponent
Returns:bool

public static bool IsComponentPartOfInstance(Sandbox.Component comp)PUBLICSTATIC

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

ParameterTypeDescription
compComponent
Returns:bool

public static bool IsGameObjectAddedToInstance(Sandbox.GameObject go)PUBLICSTATIC

`PrefabInstanceData.IsAddedGameObject(Sandbox.GameObject)`

ParameterTypeDescription
goGameObject
Returns:bool

public static bool IsGameObjectInstanceModified(Sandbox.GameObject go)PUBLICSTATIC

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

ParameterTypeDescription
goGameObject
Returns:bool

public static bool IsInstanceModified(Sandbox.GameObject prefabInstance)PUBLICSTATIC

`PrefabInstanceData.IsModified`

ParameterTypeDescription
prefabInstanceGameObject
Returns:bool

public static bool IsOuterMostPrefabRoot(object obj)PUBLICSTATIC

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

ParameterTypeDescription
objobject
Returns:bool

public static bool IsPropertyOverridden(Sandbox.SerializedProperty prop)PUBLICSTATIC

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

ParameterTypeDescription
propSerializedProperty
Returns:bool

public static void RevertComponentInstanceChanges(Sandbox.Component comp)PUBLICSTATIC

`PrefabInstanceData.RevertComponentChanges(Sandbox.Component)`

ParameterTypeDescription
compComponent
Returns:void

public static void RevertGameObjectInstanceChanges(Sandbox.GameObject go)PUBLICSTATIC

`PrefabInstanceData.RevertGameObjectChanges(Sandbox.GameObject)`

ParameterTypeDescription
goGameObject
Returns:void

public static void RevertPropertyChange(Sandbox.SerializedProperty prop)PUBLICSTATIC

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

ParameterTypeDescription
propSerializedProperty
Returns:void

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

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

ParameterTypeDescription
goGameObject
skipDiskWrite = Falsebool
Returns:void

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