Merge remote-tracking branch 'origin/master' into 1.5

This commit is contained in:
Wojciech Figat
2022-10-24 12:07:39 +02:00
12 changed files with 127 additions and 21 deletions

View File

@@ -150,9 +150,23 @@ 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.
/// </summary>
@@ -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();

View File

@@ -210,6 +210,20 @@ namespace FlaxEditor.Windows
_sceneTreePanel.HScrollBar.ThumbEnabled = enabled;
}
/// <summary>
/// Scrolls to the selected node in the scene tree.
/// </summary>
public void ScrollToSelectedNode()
{
// Scroll to node
var nodeSelection = _tree.Selection;
if (nodeSelection.Count != 0)
{
var scrollControl = nodeSelection[nodeSelection.Count - 1];
_sceneTreePanel.ScrollViewTo(scrollControl);
}
}
private void OnSearchBoxTextChanged()
{
// Skip events during setup or init stuff