moved UpdateCameraPreview call to on selection changed and on state change

This commit is contained in:
Chandler Cox
2022-10-19 20:59:55 -05:00
parent f6857f66ba
commit 5d8403be5b

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();