Prefabsclass
Methods22
Showing 22 methods
public static void AddInstanceAddedGameObjectToPrefab(Sandbox.GameObject go)
`PrefabInstanceData.AddGameObjectToPrefab(Sandbox.GameObject)`
| Parameter | Type | Description |
|---|---|---|
| go | GameObject | — |
void—public static void ApplyComponentInstanceChangesToPrefab(Sandbox.Component comp)
`PrefabInstanceData.ApplyComponentChangesToPrefab(Sandbox.Component)`
| Parameter | Type | Description |
|---|---|---|
| comp | Component | — |
void—public static void ApplyGameObjectInstanceChangesToPrefab(Sandbox.GameObject go)
`PrefabInstanceData.ApplyGameObjectChangesToPrefab(Sandbox.GameObject)`
| Parameter | Type | Description |
|---|---|---|
| go | GameObject | — |
void—public static void ApplyPropertyChange(Sandbox.SerializedProperty prop)
`PrefabInstanceData.ApplyPropertyChangeToPrefab(System.Object,System.String)`
| Parameter | Type | Description |
|---|---|---|
| prop | SerializedProperty | — |
void—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.
| Parameter | Type | Description |
|---|---|---|
| go | GameObject | — |
| saveLocation | string | — |
| skipDiskWrite = False | bool | — |
void—public static Sandbox.PrefabFile CreateAsset(Sandbox.GameObject clone)
Create a prefab out of any GameObject
Obsolete: This API member is obsolete.
| Parameter | Type | Description |
|---|---|---|
| clone | GameObject | — |
public static string GetOuterMostPrefabName(object obj)
Returns the name of the prefab file that this GameObject or Component is an instance of.
| Parameter | Type | Description |
|---|---|---|
| obj | object | — |
string—public static Sandbox.SerializedProperty GetTargets(Sandbox.GameObject root, Sandbox.PrefabVariable variable)
Get a SerializedProperty representing variable targets. Will return null if there are no targets
Obsolete: This API member is obsolete.
| Parameter | Type | Description |
|---|---|---|
| root | GameObject | — |
| variable | PrefabVariable | — |
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: This API member is obsolete.
| Parameter | Type | Description |
|---|---|---|
| obj | SerializedObject | — |
public static bool IsComponentAddedToInstance(Sandbox.Component comp)
`PrefabInstanceData.IsAddedComponent(Sandbox.Component)`
| Parameter | Type | Description |
|---|---|---|
| comp | Component | — |
bool—public static bool IsComponentInstanceModified(Sandbox.Component comp)
`PrefabInstanceData.IsComponentModified(Sandbox.Component)`
| Parameter | Type | Description |
|---|---|---|
| comp | Component | — |
bool—public static bool IsComponentPartOfInstance(Sandbox.Component comp)
Returns true if the owning GameObject is part of a prefab instance.
| Parameter | Type | Description |
|---|---|---|
| comp | Component | — |
bool—public static bool IsGameObjectAddedToInstance(Sandbox.GameObject go)
`PrefabInstanceData.IsAddedGameObject(Sandbox.GameObject)`
| Parameter | Type | Description |
|---|---|---|
| go | GameObject | — |
bool—public static bool IsGameObjectInstanceModified(Sandbox.GameObject go)
`PrefabInstanceData.IsGameObjectModified(Sandbox.GameObject,System.Boolean)`
| Parameter | Type | Description |
|---|---|---|
| go | GameObject | — |
bool—public static bool IsInstanceModified(Sandbox.GameObject prefabInstance)
`PrefabInstanceData.IsModified`
| Parameter | Type | Description |
|---|---|---|
| prefabInstance | GameObject | — |
bool—public static bool IsOuterMostPrefabRoot(object obj)
Returns the name of the prefab file that this GameObject or Component is an instance of.
| Parameter | Type | Description |
|---|---|---|
| obj | object | — |
bool—public static bool IsPropertyOverridden(Sandbox.SerializedProperty prop)
`PrefabInstanceData.IsPropertyOverridden(System.Object,System.String,System.Boolean)`
| Parameter | Type | Description |
|---|---|---|
| prop | SerializedProperty | — |
bool—public static void RevertComponentInstanceChanges(Sandbox.Component comp)
`PrefabInstanceData.RevertComponentChanges(Sandbox.Component)`
| Parameter | Type | Description |
|---|---|---|
| comp | Component | — |
void—public static void RevertGameObjectInstanceChanges(Sandbox.GameObject go)
`PrefabInstanceData.RevertGameObjectChanges(Sandbox.GameObject)`
| Parameter | Type | Description |
|---|---|---|
| go | GameObject | — |
void—public static void RevertPropertyChange(Sandbox.SerializedProperty prop)
`PrefabInstanceData.RevertPropertyChange(System.Object,System.String)`
| Parameter | Type | Description |
|---|---|---|
| prop | SerializedProperty | — |
void—public static void WriteInstanceToPrefab(Sandbox.GameObject go, bool skipDiskWrite = False)
Write a prefab instance back to the prefab file and save it to disk.
| Parameter | Type | Description |
|---|---|---|
| go | GameObject | — |
| skipDiskWrite = False | bool | — |
void—No results match this filter.