diff --git a/Source/Editor/Windows/Assets/PrefabWindow.cs b/Source/Editor/Windows/Assets/PrefabWindow.cs index 714a4e6cf..aa78c06a2 100644 --- a/Source/Editor/Windows/Assets/PrefabWindow.cs +++ b/Source/Editor/Windows/Assets/PrefabWindow.cs @@ -45,6 +45,8 @@ namespace FlaxEditor.Windows.Assets private DateTime _modifiedTime = DateTime.MinValue; private bool _isDropping = false; + private bool _lockSelection = false; + /// /// Gets the prefab hierarchy tree control. /// @@ -76,7 +78,18 @@ namespace FlaxEditor.Windows.Assets /// /// Indication of if the prefab window selection is locked on specific objects. /// - public bool LockSelectedObjects = false; + public bool LockSelectedObjects + { + get => _lockSelection; + set + { + if (_lockSelection == value) + return; + _lockSelection = value; + if (!value) + OnSelectionChanged(Graph.Root.SceneContext.Selection.ToArray()); + } + } /// /// Gets or sets a value indicating whether use live reloading for the prefab changes (applies prefab changes on modification by auto). diff --git a/Source/Editor/Windows/PropertiesWindow.cs b/Source/Editor/Windows/PropertiesWindow.cs index b9ac18e50..87474fc3a 100644 --- a/Source/Editor/Windows/PropertiesWindow.cs +++ b/Source/Editor/Windows/PropertiesWindow.cs @@ -22,6 +22,7 @@ namespace FlaxEditor.Windows private IEnumerable undoRecordObjects; private readonly Dictionary _actorScrollValues = new Dictionary(); + private bool _lockObjects = false; /// public override bool UseLayoutData => true; @@ -44,7 +45,18 @@ namespace FlaxEditor.Windows /// /// Indication of if the properties window is locked on specific objects. /// - public bool LockObjects = false; + public bool LockObjects + { + get => _lockObjects; + set + { + if (value == _lockObjects) + return; + _lockObjects = value; + if (!value) + OnSelectionChanged(); + } + } /// /// Initializes a new instance of the class.