Class PrefabWindow
Prefab window allows to view and edit Prefab asset.
Inheritance
Namespace: FlaxEditor.Windows.Assets
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class PrefabWindow : AssetEditorWindowBase<Prefab>, IComparable, IDrawable, IEditable, IContentItemOwner, IPresenterOwner, ISceneEditingContext
Constructors
PrefabWindow(Editor, AssetItem)
Declaration
public PrefabWindow(Editor editor, AssetItem item)
Parameters
|
Editor
editor
|
|
FlaxEditor.Content.AssetItem
item
|
Fields
Graph
The local scene nodes graph used by the prefab editor.
Declaration
public readonly LocalSceneGraph Graph
Field Value
|
FlaxEditor.SceneGraph.LocalSceneGraph
|
Properties
LiveReload
Gets or sets a value indicating whether use live reloading for the prefab changes (applies prefab changes on modification by auto).
Declaration
public bool LiveReload { get; set; }
Property Value
|
System.Boolean
|
LiveReloadTimeout
Gets or sets the live reload timeout. It defines the time to apply prefab changes after modification.
Declaration
public TimeSpan LiveReloadTimeout { get; set; }
Property Value
|
System.TimeSpan
|
LockSelection
Indication of if the prefab window selection is locked on specific objects.
Declaration
public bool LockSelection { get; set; }
Property Value
|
System.Boolean
|
Implements
Presenter
Gets the prefab objects properties editor.
Declaration
public CustomEditorPresenter Presenter { get; }
Property Value
|
FlaxEditor.CustomEditors.CustomEditorPresenter
|
PresenterViewport
Gets the viewport linked with properties presenter (optional, null if unused).
Declaration
public EditorViewport PresenterViewport { get; }
Property Value
|
EditorViewport
|
Implements
SceneContext
Gets the scene editing context.
Declaration
public ISceneEditingContext SceneContext { get; }
Property Value
|
ISceneEditingContext
|
Implements
Selection
Gets the current selection.
Declaration
public List<SceneGraphNode> Selection { get; }
Property Value
|
System.Collections.Generic.List<FlaxEditor.SceneGraph.SceneGraphNode>
|
Implements
Tree
Gets the prefab hierarchy tree control.
Declaration
public PrefabWindow.PrefabTree Tree { get; }
Property Value
|
PrefabWindow.PrefabTree
|
Undo
Gets the undo system used by this window for changes tracking.
Declaration
public Undo Undo { get; }
Property Value
|
Undo
|
UseLayoutData
Gets a value indicating whether window uses custom layout data.
Declaration
public override bool UseLayoutData { get; }
Property Value
|
System.Boolean
|
Overrides
Viewport
Gets the viewport.
Declaration
public PrefabWindowViewport Viewport { get; }
Property Value
|
PrefabWindowViewport
|
Methods
Copy()
Copies selected objects to system clipboard.
Declaration
public void Copy()
Cut()
Cuts selected objects.
Declaration
public void Cut()
Delete()
Deletes selected objects.
Declaration
public void Delete()
DeleteSelection()
Deletes selected objects.
Declaration
public void DeleteSelection()
Implements
Deselect()
Clears the selection.
Declaration
public void Deselect()
Deselect(SceneGraphNode)
Deselects the specified node.
Declaration
public void Deselect(SceneGraphNode node)
Parameters
|
FlaxEditor.SceneGraph.SceneGraphNode
node
|
Implements
Duplicate()
Duplicates selected objects.
Declaration
public void Duplicate()
FocusSelection()
Focuses selected objects.
Declaration
public void FocusSelection()
Implements
OnAssetLoaded()
Called when asset gets loaded and window can setup UI for it.
Declaration
protected override void OnAssetLoaded()
Overrides
OnClose()
Called when window is closed.
Declaration
protected override void OnClose()
Overrides
OnDestroy()
Method called when managed instance should be destroyed
Declaration
public override void OnDestroy()
Overrides
OnEditedState()
Action fired when object gets edited.
Declaration
protected override void OnEditedState()
Overrides
OnLayoutDeserialize()
Called when during windows layout deserialization if window has no layout data to load. Can be used to restore default UI layout.
Declaration
public override void OnLayoutDeserialize()
Overrides
OnLayoutDeserialize(XmlElement)
Called when during windows layout deserialization. Each window can use it to load custom interface data (eg. splitter position).
Declaration
public override void OnLayoutDeserialize(XmlElement node)
Parameters
|
System.Xml.XmlElement
node
The Xml document node. |
Overrides
OnLayoutSerialize(XmlWriter)
Called when during windows layout serialization. Each window can use it to store custom interface data (eg. splitter position).
Declaration
public override void OnLayoutSerialize(XmlWriter writer)
Parameters
|
System.Xml.XmlWriter
writer
The Xml writer. |
Overrides
OnMouseUp(Float2, MouseButton)
When mouse goes up over control's area
Declaration
public override bool OnMouseUp(Float2 location, MouseButton button)
Parameters
|
Float2
location
Mouse location in Control Space |
|
MouseButton
button
Mouse buttons state (flags) |
Returns
|
System.Boolean
True if event has been handled, otherwise false |
Overrides
OnScriptsReloadBegin()
Declaration
protected override void OnScriptsReloadBegin()
Overrides
OnSelectionChanged(SceneGraphNode[])
Called when selection gets changed.
Declaration
public void OnSelectionChanged(SceneGraphNode[] before)
Parameters
|
FlaxEditor.SceneGraph.SceneGraphNode[]
before
The selection before the change. |
Paste()
Pastes objects from the system clipboard.
Declaration
public void Paste()
Paste(Actor)
Pastes the copied objects. Supports undo/redo.
Declaration
public void Paste(Actor pasteTargetActor)
Parameters
|
Actor
pasteTargetActor
The target actor to paste copied data. |
RenameSelection()
Opends popup for renaming selected objects.
Declaration
public void RenameSelection()
Implements
Save()
Tries to save asset changes if it has been edited.
Declaration
public override void Save()
Overrides
ScrollingOnTreeView(Boolean)
Enables or disables vertical and horizontal scrolling on the tree panel.
Declaration
public void ScrollingOnTreeView(bool enabled)
Parameters
|
System.Boolean
enabled
The state to set scrolling to |
ScrollToSelectedNode()
Scrolls to the selected node in the tree.
Declaration
public void ScrollToSelectedNode()
Select(SceneGraphNode, Boolean)
Selects the specified node.
Declaration
public void Select(SceneGraphNode node, bool additive = false)
Parameters
|
FlaxEditor.SceneGraph.SceneGraphNode
node
The node. |
|
System.Boolean
additive
if set to |
Implements
Select(List<SceneGraphNode>)
Selects the specified nodes collection.
Declaration
public void Select(List<SceneGraphNode> nodes)
Parameters
|
System.Collections.Generic.List<FlaxEditor.SceneGraph.SceneGraphNode>
nodes
The nodes. |
Implements
Spawn(Actor)
Spawns the specified actor to the prefab (adds actor to root).
Declaration
public void Spawn(Actor actor)
Parameters
|
Actor
actor
The actor. |
Spawn(Actor, Actor, Int32, Boolean)
Spawns the specified actor.
Declaration
public void Spawn(Actor actor, Actor parent, int orderInParent = -1, bool autoSelect = true)
Parameters
|
Actor
actor
The actor. |
|
Actor
parent
The parent. |
|
System.Int32
orderInParent
The order of the actor under the parent. |
|
System.Boolean
autoSelect
True if automatically select the spawned actor, otherwise false. |
Implements
Spawn(Type)
Spawns the actor of the specified type to the prefab (adds actor to root).
Declaration
public void Spawn(Type type)
Parameters
|
System.Type
type
The actor type. |
UnlinkItem()
Unlinks the item. Removes reference to it and unbinds all events.
Declaration
protected override void UnlinkItem()
Overrides
Update(Single)
Perform control update and all its children
Declaration
public override void Update(float deltaTime)
Parameters
|
System.Single
deltaTime
Delta time in seconds |
Overrides
UpdateToolstrip()
Updates the toolstrip buttons and other controls. Called after some window events.
Declaration
protected override void UpdateToolstrip()
Overrides
Events
ContextMenuShow
Occurs when prefab hierarchy panel wants to show the context menu. Allows to add custom options. Applies to all prefab windows.
Declaration
public static event Action<ContextMenu> ContextMenuShow
Event Type
|
System.Action<FlaxEditor.GUI.ContextMenu.ContextMenu>
|
SelectionChanged
Occurs when selection gets changed.
Declaration
public event Action SelectionChanged
Event Type
|
System.Action
|
Explicit Interface Implementations
ISceneEditingContext.Viewport
Gets the main or last editor viewport used for scene editing within this context.
Declaration
EditorViewport ISceneEditingContext.Viewport { get; }
Returns
|
EditorViewport
|