Merge branch 'move-updatecamerapreview' of https://github.com/Tryibion/FlaxEngine into Tryibion-move-updatecamerapreview

This commit is contained in:
Wojtek Figat
2022-10-23 19:15:46 +02:00

View File

@@ -150,8 +150,22 @@ namespace FlaxEditor.Windows
};
Viewport.Task.ViewFlags = ViewFlags.DefaultEditor;
Editor.SceneEditing.SelectionChanged += OnSelectionChanged;
Editor.Scene.ActorRemoved += SceneOnActorRemoved;
}
/// <inheritdoc />
public override void OnEditorStateChanged()
{
base.OnEditorStateChanged();
UpdateCameraPreview();
}
private void OnSelectionChanged()
{
UpdateCameraPreview();
}
/// <summary>
/// Gets a value indicating whether actor pilot feature is active and in use.
@@ -376,9 +390,6 @@ namespace FlaxEditor.Windows
/// <inheritdoc />
public override void Update(float deltaTime)
{
// TODO: call camera preview update only on selection change, or state change
UpdateCameraPreview();
if (Root.GetKeyDown(KeyboardKeys.F12))
{
Viewport.TakeScreenshot();