Class PrefabsModule
Prefabs management module.
Inheritance
Namespace: FlaxEditor.Modules
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class PrefabsModule : EditorModule
Methods
ApplyAll(Actor)
Applies the difference from the prefab object instance, saves the changes and synchronizes them with the active instances of the prefab asset.
Declaration
public void ApplyAll(Actor instance)
Parameters
Actor
instance
The modified instance. |
Remarks
Applies all the changes from not only the given actor instance but all actors created within that prefab instance.
BreakLinks()
Breaks any prefab links for the selected objects. Supports undo/redo.
Declaration
public void BreakLinks()
CreatePrefab()
Starts the creating prefab for the selected actor by showing the new item creation dialog in ContentWindow.
Declaration
public void CreatePrefab()
Remarks
To create prefab manually (from code) use CreatePrefab(Actor, String, Boolean) method.
CreatePrefab(Actor)
Starts the creating prefab for the given actor by showing the new item creation dialog in ContentWindow. User can specify the new asset name.
Declaration
public void CreatePrefab(Actor actor)
Parameters
Actor
actor
The root prefab actor. |
Remarks
To create prefab manually (from code) use CreatePrefab(Actor, String, Boolean) method.
CreatePrefab(Actor, Boolean, PrefabWindow)
Starts the creating prefab for the given actor by showing the new item creation dialog in ContentWindow.
Declaration
public void CreatePrefab(Actor actor, bool rename, PrefabWindow prefabWindow = null)
Parameters
Actor
actor
The root prefab actor. |
System.Boolean
rename
Allow renaming or not |
PrefabWindow
prefabWindow
The prefab window that creates it. |
CreatePrefab(List<SceneGraphNode>, PrefabWindow)
Starts the creating prefab for the selected actor by showing the new item creation dialog in ContentWindow.
Declaration
public void CreatePrefab(List<SceneGraphNode> selection, PrefabWindow prefabWindow = null)
Parameters
System.Collections.Generic.List<FlaxEditor.SceneGraph.SceneGraphNode>
selection
The scene selection to use. |
PrefabWindow
prefabWindow
The prefab window that creates it. |
Remarks
To create prefab manually (from code) use CreatePrefab(Actor, String, Boolean) method.
SelectPrefab()
Selects in Content Window the prefab asset used by the selected objects.
Declaration
public void SelectPrefab()
Events
PrefabApplied
Occurs after applying changes to the prefab. Arguments are prefab and the target instance.
Declaration
public event Action<Prefab, Actor> PrefabApplied
Event Type
System.Action<Prefab, Actor>
|
PrefabApplying
Occurs before applying changes to the prefab. Arguments are prefab and the target instance.
Declaration
public event Action<Prefab, Actor> PrefabApplying
Event Type
System.Action<Prefab, Actor>
|
PrefabCreated
Occurs after prefab asset creating. Arguments is created prefab asset item.
Declaration
public event Action<PrefabItem> PrefabCreated
Event Type
System.Action<PrefabItem>
|
PrefabCreating
Occurs before prefab asset creating. Argument is a target actor.
Declaration
public event Action<Actor> PrefabCreating
Event Type
System.Action<Actor>
|