Add support for AssetPreview to use debug drawing if needed

This commit is contained in:
Wojtek Figat
2021-06-01 10:27:30 +02:00
parent 2c2c7744eb
commit 623299e59f
5 changed files with 135 additions and 53 deletions

View File

@@ -22,7 +22,7 @@ namespace FlaxEditor.Viewport
/// Main editor gizmo viewport used by the <see cref="EditGameWindow"/>.
/// </summary>
/// <seealso cref="FlaxEditor.Viewport.EditorGizmoViewport" />
public partial class MainEditorGizmoViewport : EditorGizmoViewport, IEditorPrimitivesOwner
public partial class MainEditorGizmoViewport : EditorGizmoViewport, IEditorPrimitivesOwner, IGizmoOwner
{
private readonly Editor _editor;
@@ -463,6 +463,12 @@ namespace FlaxEditor.Viewport
DebugDraw.Draw(ref renderContext, target.View(), targetDepth.View(), true);
}
// Draw gizmos
for (int i = 0; i < Gizmos.Count; i++)
{
Gizmos[i].Draw(ref renderContext);
}
}
private void OnPostRender(GPUContext context, RenderContext renderContext)
@@ -660,7 +666,7 @@ namespace FlaxEditor.Viewport
var orientation = ViewOrientation;
FocusSelection(ref orientation);
}
/// <summary>
/// Focuses the viewport on the current selection of the gizmo.
/// </summary>