Add spacebar for play/pause in animated model and particles previews

This commit is contained in:
Wojtek Figat
2023-02-02 15:53:55 +01:00
parent b64475bcfa
commit 50faa49c0f
2 changed files with 16 additions and 1 deletions

View File

@@ -428,8 +428,12 @@ namespace FlaxEditor.Viewport.Previews
case KeyboardKeys.F:
// Pay respect..
ViewportCamera.SetArcBallView(_previewModel.Box);
break;
return true;
case KeyboardKeys.Spacebar:
PlayAnimation = !PlayAnimation;
return true;
}
return base.OnKeyDown(key);
}

View File

@@ -264,6 +264,16 @@ namespace FlaxEditor.Viewport.Previews
/// <inheritdoc />
public override bool OnKeyDown(KeyboardKeys key)
{
switch (key)
{
case KeyboardKeys.F:
ViewportCamera.SetArcBallView(_previewEffect.Box);
return true;
case KeyboardKeys.Spacebar:
PlaySimulation = !PlaySimulation;
return true;
}
var inputOptions = Editor.Instance.Options.Options.Input;
if (inputOptions.Play.Process(this, key))
{
@@ -275,6 +285,7 @@ namespace FlaxEditor.Viewport.Previews
PlaySimulation = false;
return true;
}
return base.OnKeyDown(key);
}