public static abstract sealed class Editor.EditorUtility.Prefabs
Related Guides
Broader workflow and conceptual references connected to this API.
You can record gameplay into a MovieClip, which can be played back or imported into Movie Maker for editing. This could be useful for killcams in shooters, leaderboard replays in racing games, or for capturing gameplay to edit into a trailer.
This section needs to be rewritten with an explanation of all the code, libraries, etc.
The Clutter System lets you quickly scatter large amounts of small objects like grass, rocks, and debris across your scene. It handles placement, streaming, and GPU-instanced rendering for models automatically.
Prefab instance overrides allow you to customize individual instances of a prefab without affecting the original prefab or other instances. This lets you create variations of the same prefab while maintaining the connection to the original template.
The "Model Editor", also known as "ModelDoc", is where you can create and edit model (VMDL) files. This is the modern equivalent of Source 1's .QC files. You can find it under the "Tools" menu.
A prefab is a GameObject that can be used in multiple places. They're usually used to contain an object that is used across multiple scenes, or needs to be instantiated at runtime.
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 Sandbox.PrefabScene.VariableCollection GetVariables(Sandbox.SerializedObject obj)Obsolete
Obsolete: This API member is obsolete.
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
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | global |
| Type | class |
| Assembly | Sandbox.Tools |
| Doc ID | T:Editor.EditorUtility.Prefabs |