Refactor ISceneContextWindow into ISceneEditingContext with more utilities

#3257
This commit is contained in:
Wojtek Figat
2025-03-03 23:32:27 +01:00
parent e82bb639ed
commit 819ce2222d
10 changed files with 91 additions and 30 deletions

View File

@@ -41,7 +41,7 @@ namespace FlaxEditor.Windows.Assets
public override Undo Undo => _window.Undo;
/// <inheritdoc />
public override List<SceneGraphNode> Selection => _window.Selection;
public override ISceneEditingContext SceneContext => _window;
}
/// <summary>

View File

@@ -12,10 +12,7 @@ namespace FlaxEditor.Windows.Assets
{
public sealed partial class PrefabWindow
{
/// <summary>
/// The current selection (readonly).
/// </summary>
public readonly List<SceneGraphNode> Selection = new List<SceneGraphNode>();
private readonly List<SceneGraphNode> _selection = new List<SceneGraphNode>();
/// <summary>
/// Occurs when selection gets changed.

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using System.Xml;
using FlaxEditor.Content;
using FlaxEditor.CustomEditors;
@@ -19,7 +20,7 @@ namespace FlaxEditor.Windows.Assets
/// </summary>
/// <seealso cref="Prefab" />
/// <seealso cref="FlaxEditor.Windows.Assets.AssetEditorWindow" />
public sealed partial class PrefabWindow : AssetEditorWindowBase<Prefab>, IPresenterOwner, ISceneContextWindow
public sealed partial class PrefabWindow : AssetEditorWindowBase<Prefab>, IPresenterOwner, ISceneEditingContext
{
private readonly SplitPanel _split1;
private readonly SplitPanel _split2;
@@ -54,6 +55,9 @@ namespace FlaxEditor.Windows.Assets
/// </summary>
public PrefabWindowViewport Viewport => _viewport;
/// <inheritdoc />
public List<SceneGraphNode> Selection => _selection;
/// <summary>
/// Gets the prefab objects properties editor.
/// </summary>
@@ -557,5 +561,8 @@ namespace FlaxEditor.Windows.Assets
/// <inheritdoc />
public EditorViewport PresenterViewport => _viewport;
/// <inheritdoc />
EditorViewport ISceneEditingContext.Viewport => Viewport;
}
}