Add toggle orthographic view hotkey

Adds the Toggle Orthographic hotkey to the editor. Bound to 'NumpadDecimal' by default.
This commit is contained in:
rkrahn
2024-03-10 13:49:14 -07:00
parent 41cff47ca3
commit eac553a992
2 changed files with 5 additions and 0 deletions

View File

@@ -320,6 +320,10 @@ namespace FlaxEditor.Options
[EditorDisplay("Viewport"), EditorOrder(1750)]
public InputBinding ViewpointBottom = new InputBinding(KeyboardKeys.Numpad2);
[DefaultValue(typeof(InputBinding), "NumpadDecimal")]
[EditorDisplay("Viewport"), EditorOrder(1760)]
public InputBinding ToggleOrthographic = new InputBinding(KeyboardKeys.NumpadDecimal);
#endregion
#region Interface

View File

@@ -998,6 +998,7 @@ namespace FlaxEditor.Viewport
InputActions.Add(options => options.CameraToggleRotation, () => _isVirtualMouseRightDown = !_isVirtualMouseRightDown);
InputActions.Add(options => options.CameraIncreaseMoveSpeed, () => AdjustCameraMoveSpeed(1));
InputActions.Add(options => options.CameraDecreaseMoveSpeed, () => AdjustCameraMoveSpeed(-1));
InputActions.Add(options => options.ToggleOrthographic, () => OnOrthographicModeToggled(null));
// Link for task event
task.Begin += OnRenderBegin;