Api Prefabs
class

Prefabs

public static abstract sealed class Prefabs

Methods

static Boolean IsOuterMostPrefabRoot(Object obj)

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

static String GetOuterMostPrefabName(Object obj)

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

static Boolean IsPropertyOverridden(SerializedProperty prop)

Boolean)

static Boolean IsGameObjectAddedToInstance(GameObject go)

GameObject)

static Boolean IsComponentAddedToInstance(Component comp)

Component)

static Boolean IsInstanceModified(GameObject prefabInstance)

IsModified

static Boolean IsGameObjectInstanceModified(GameObject go)

Boolean)

static Boolean IsComponentInstanceModified(Component comp)

Component)

static Boolean IsComponentPartOfInstance(Component comp)

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

static Void RevertPropertyChange(SerializedProperty prop)

String)

static Void ApplyPropertyChange(SerializedProperty prop)

String)

static Void RevertComponentInstanceChanges(Component comp)

Component)

static Void RevertGameObjectInstanceChanges(GameObject go)

GameObject)

static Void ApplyComponentInstanceChangesToPrefab(Component comp)

Component)

static Void AddInstanceAddedGameObjectToPrefab(GameObject go)

GameObject)

static Void ApplyGameObjectInstanceChangesToPrefab(GameObject go)

GameObject)

static Void RevertInstanceToPrefab(GameObject go)

Revert a prefab instance to the state of the prefab.

static Void WriteInstanceToPrefab(GameObject go, Boolean skipDiskWrite = False)

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

static Void ConvertGameObjectToPrefab(GameObject go, String saveLocation, Boolean 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.

static SerializedProperty GetTargets(GameObject root, PrefabVariable variable)

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

static VariableCollection GetVariables(SerializedObject obj)
static PrefabFile CreateAsset(GameObject clone)

Create a prefab out of any GameObject

static IEnumerable<PrefabFile> GetTemplates()

Fetches all prefab templates to show in Create GameObject menus

Assembly: Sandbox.Tools Declaring Type: EditorUtility Full Name: Editor.EditorUtility.Prefabs