Add grid gizmo to prefab scene.
This commit is contained in:
@@ -99,6 +99,16 @@ namespace FlaxEditor.Viewport
|
||||
ShowEditorPrimitives = true;
|
||||
Gizmos = new GizmosCollection(this);
|
||||
|
||||
_gridGizmo = new GridGizmo(this);
|
||||
var showGridButton = ViewWidgetShowMenu.AddButton("Grid");
|
||||
showGridButton.Clicked += () =>
|
||||
{
|
||||
_gridGizmo.Enabled = !_gridGizmo.Enabled;
|
||||
showGridButton.Checked = _gridGizmo.Enabled;
|
||||
};
|
||||
showGridButton.Checked = true;
|
||||
showGridButton.CloseMenuOnClick = false;
|
||||
|
||||
// Prepare rendering task
|
||||
Task.ActorsSource = ActorsSources.CustomActors;
|
||||
Task.ViewFlags = ViewFlags.DefaultEditor;
|
||||
@@ -267,6 +277,8 @@ namespace FlaxEditor.Viewport
|
||||
/// <inheritdoc />
|
||||
public GizmosCollection Gizmos { get; }
|
||||
|
||||
private GridGizmo _gridGizmo;
|
||||
|
||||
/// <inheritdoc />
|
||||
public SceneRenderTask RenderTask => Task;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user