Class PrefabWindowViewport
Editor viewport used by the PrefabWindow
Inheritance
Implements
Namespace: FlaxEditor.Viewport
Assembly: FlaxEngine.CSharp.dll
Syntax
public class PrefabWindowViewport : PrefabPreview, IComparable, IDrawable, IEditorPrimitivesOwner, IGizmoOwnerConstructors
PrefabWindowViewport(PrefabWindow)
Initializes a new instance of the PrefabWindowViewport class.
Declaration
public PrefabWindowViewport(PrefabWindow window)Parameters
| PrefabWindow
        window Editor window. | 
Fields
DragHandlers
Drag and drop handlers
Declaration
public readonly ViewportDragHandlers DragHandlersField Value
| ViewportDragHandlers 
 | 
SelectionOutline
The selection outline postFx.
Declaration
public SelectionOutline SelectionOutlineField Value
| FlaxEditor.Gizmo.SelectionOutline 
 | 
TransformGizmo
The transform gizmo.
Declaration
public readonly TransformGizmo TransformGizmoField Value
| FlaxEditor.Gizmo.TransformGizmo 
 | 
Properties
Gizmos
Declaration
public GizmosCollection Gizmos { get; }Property Value
| FlaxEditor.Gizmo.GizmosCollection 
 | 
IsAltKeyDown
Declaration
public bool IsAltKeyDown { get; }Property Value
| System.Boolean 
 | 
IsControlDown
Declaration
public bool IsControlDown { get; }Property Value
| System.Boolean 
 | 
IsControllingMouse
Gets a value indicating whether this viewport is using mouse currently (eg. user moving objects).
Declaration
protected override bool IsControllingMouse { get; }Property Value
| System.Boolean 
 | 
Overrides
IsLeftMouseButtonDown
Declaration
public bool IsLeftMouseButtonDown { get; }Property Value
| System.Boolean 
 | 
IsRightMouseButtonDown
Declaration
public bool IsRightMouseButtonDown { get; }Property Value
| System.Boolean 
 | 
MouseDelta
RenderTask
SceneGraphRoot
Declaration
public RootNode SceneGraphRoot { get; }Property Value
| FlaxEditor.SceneGraph.RootNode 
 | 
ShowUI
Whether to show the UI mode or not.
Declaration
public bool ShowUI { get; set; }Property Value
| System.Boolean 
 | 
SnapToGround
Declaration
public bool SnapToGround { get; }Property Value
| System.Boolean 
 | 
SnapToVertex
Declaration
public bool SnapToVertex { get; }Property Value
| System.Boolean 
 | 
Undo
UseDuplicate
Declaration
public bool UseDuplicate { get; }Property Value
| System.Boolean 
 | 
UseSnapping
Declaration
public bool UseSnapping { get; }Property Value
| System.Boolean 
 | 
ViewFarPlane
Declaration
public float ViewFarPlane { get; }Property Value
| System.Single 
 | 
Viewport
Methods
AddUpdateCallbacks(RootControl)
Adds the custom control logic update callbacks to the root.
Declaration
protected override void AddUpdateCallbacks(RootControl root)Parameters
| RootControl
        root The root. | 
Overrides
ApplyTransform(List<SceneGraphNode>, ref Vector3, ref Quaternion, ref Vector3)
Applies the transform to the collection of scene graph nodes.
Declaration
public void ApplyTransform(List<SceneGraphNode> selection, ref Vector3 translationDelta, ref Quaternion rotationDelta, ref Vector3 scaleDelta)Parameters
| System.Collections.Generic.List<FlaxEditor.SceneGraph.SceneGraphNode>
        selection The selection. | 
| Vector3
        translationDelta The translation delta. | 
| Quaternion
        rotationDelta The rotation delta. | 
| Vector3
        scaleDelta The scale delta. | 
CreateViewScalingOptions()
Creates the view scaling options. Needs to be called after a Prefab is valid and loaded.
Declaration
public void CreateViewScalingOptions()DrawEditorPrimitives(GPUContext, ref RenderContext, GPUTexture, GPUTexture)
Declaration
public override void DrawEditorPrimitives(GPUContext context, ref RenderContext renderContext, GPUTexture target, GPUTexture targetDepth)Parameters
| GPUContext
        context 
 | 
| RenderContext
        renderContext 
 | 
| GPUTexture
        target 
 | 
| GPUTexture
        targetDepth 
 | 
Overrides
FocusSelection()
Focuses the viewport on the current selection of the gizmo.
Declaration
public void FocusSelection()FocusSelection(ref Quaternion)
Focuses the viewport on the current selection of the gizmo.
Declaration
public void FocusSelection(ref Quaternion orientation)Parameters
| Quaternion
        orientation The target view orientation. | 
OnDebugDraw(GPUContext, ref RenderContext)
Called when drawing debug shapes with DebugDraw for this viewport.
Declaration
protected override void OnDebugDraw(GPUContext context, ref RenderContext renderContext)Parameters
| GPUContext
        context The GPU context. | 
| RenderContext
        renderContext The render context. | 
Overrides
OnDestroy()
OnDragDrop(ref Float2, DragData)
When mouse dragging drops on control's area
Declaration
public override DragDropEffect OnDragDrop(ref Float2 location, DragData data)Parameters
| Float2
        location Mouse location in Control Space | 
| DragData
        data The data. See DragDataText and DragDataFiles. | 
Returns
| DragDropEffect The drag event result effect. | 
Overrides
OnDragEnter(ref Float2, DragData)
When mouse dragging enters control's area
Declaration
public override DragDropEffect OnDragEnter(ref Float2 location, DragData data)Parameters
| Float2
        location Mouse location in Control Space | 
| DragData
        data The data. See DragDataText and DragDataFiles. | 
Returns
| DragDropEffect The drag event result effect. | 
Overrides
OnDragLeave()
When mouse dragging leaves control's area
Declaration
public override void OnDragLeave()Overrides
OnDragMove(ref Float2, DragData)
When mouse dragging moves over control's area
Declaration
public override DragDropEffect OnDragMove(ref Float2 location, DragData data)Parameters
| Float2
        location Mouse location in Control Space | 
| DragData
        data The data. See DragDataText and DragDataFiles. | 
Returns
| DragDropEffect The drag event result effect. | 
Overrides
OnLeftMouseButtonUp()
Called when left mouse button goes up (on release).
Declaration
protected override void OnLeftMouseButtonUp()Overrides
OpenContextMenu()
Declaration
public void OpenContextMenu()OrientViewport(ref Quaternion)
Orients the viewport.
Declaration
protected override void OrientViewport(ref Quaternion orientation)Parameters
| Quaternion
        orientation The orientation. | 
Overrides
RemoveUpdateCallbacks(RootControl)
Removes the custom control logic update callbacks from the root.
Declaration
protected override void RemoveUpdateCallbacks(RootControl root)Parameters
| RootControl
        root The root. | 
Overrides
SaveActiveUIScalingOption()
Saves the active ui scaling option.
Declaration
public void SaveActiveUIScalingOption()Select(List<SceneGraphNode>)
Declaration
public void Select(List<SceneGraphNode> nodes)Parameters
| System.Collections.Generic.List<FlaxEditor.SceneGraph.SceneGraphNode>
        nodes 
 | 
SetInitialUIMode(Boolean)
set the initial UI mod
Declaration
public void SetInitialUIMode(bool value)Parameters
| System.Boolean
        value the initial ShowUI value | 
ShowSelectedActors()
Moves the viewport to visualize selected actors.
Declaration
public void ShowSelectedActors()Spawn(Actor)
Events
UIModeToggled
Event fired when the UI Mode is toggled.
Declaration
public event Action<bool> UIModeToggledEvent Type
| System.Action<System.Boolean> 
 |