diff --git a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs index 31e1490d6..def57b332 100644 --- a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs @@ -55,9 +55,8 @@ namespace FlaxEditor.CustomEditors.Dedicated { // TODO: consider editing more than one instance of the same prefab asset at once - var prefab = FlaxEngine.Content.LoadAsync(actor.PrefabID); - // TODO: don't stall here? - if (prefab && !prefab.WaitForLoaded()) + var prefab = FlaxEngine.Content.Load(actor.PrefabID); + if (prefab) { var prefabObjectId = actor.PrefabObjectID; var prefabInstance = prefab.GetDefaultInstance(ref prefabObjectId); diff --git a/Source/Editor/Windows/ContentWindow.Navigation.cs b/Source/Editor/Windows/ContentWindow.Navigation.cs index cc9429d47..4c7373aa6 100644 --- a/Source/Editor/Windows/ContentWindow.Navigation.cs +++ b/Source/Editor/Windows/ContentWindow.Navigation.cs @@ -14,6 +14,7 @@ namespace FlaxEditor.Windows private void OnTreeSelectionChanged(List from, List to) { + bool setLastViewFolder = !IsLayoutLocked; if (!_showAllContentInTree && to.Count > 1) { _tree.Select(to[^1]); @@ -21,11 +22,14 @@ namespace FlaxEditor.Windows } if (_showAllContentInTree && to.Count > 1) { - var activeNode = GetActiveTreeSelection(to); - if (activeNode is ContentItemTreeNode itemNode) - SaveLastViewedFolder(itemNode.Item?.ParentFolder?.Node); - else - SaveLastViewedFolder(activeNode as ContentFolderTreeNode); + if (setLastViewFolder) + { + var activeNode = GetActiveTreeSelection(to); + if (activeNode is ContentItemTreeNode itemNode) + SaveLastViewedFolder(itemNode.Item?.ParentFolder?.Node); + else + SaveLastViewedFolder(activeNode as ContentFolderTreeNode); + } UpdateUI(); return; } @@ -35,7 +39,8 @@ namespace FlaxEditor.Windows var targetNode = GetActiveTreeSelection(to); if (targetNode is ContentItemTreeNode itemNode2) { - SaveLastViewedFolder(itemNode2.Item?.ParentFolder?.Node); + if (setLastViewFolder) + SaveLastViewedFolder(itemNode2.Item?.ParentFolder?.Node); UpdateUI(); itemNode2.Focus(); return; @@ -44,7 +49,8 @@ namespace FlaxEditor.Windows var target = targetNode as ContentFolderTreeNode; Navigate(source, target); - SaveLastViewedFolder(target); + if (setLastViewFolder) + SaveLastViewedFolder(target); target?.Focus(); } diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index f61dfa903..2141b283e 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -1227,8 +1227,6 @@ namespace FlaxEditor.Windows UpdateItemsSearch(); else RefreshView(SelectedNode); - - return; } /// diff --git a/Source/Engine/Level/Prefabs/Prefab.h b/Source/Engine/Level/Prefabs/Prefab.h index 9e6023a82..cde99a2cb 100644 --- a/Source/Engine/Level/Prefabs/Prefab.h +++ b/Source/Engine/Level/Prefabs/Prefab.h @@ -60,12 +60,14 @@ public: /// /// Requests the default prefab object instance. Deserializes the prefab objects from the asset. Skips if already done. /// + /// Default instances of the prefab are read-only and are used internally for objects serialization (prefab diff). /// The root of the prefab object loaded from the prefab. Contains the default values. It's not added to gameplay but deserialized with postLoad and init event fired. API_FUNCTION() Actor* GetDefaultInstance(); /// /// Requests the default prefab object instance. Deserializes the prefab objects from the asset. Skips if already done. /// + /// Default instances of the prefab are read-only and are used internally for objects serialization (prefab diff). /// The ID of the object to get from prefab default object. It can be one of the child-actors or any script that exists in the prefab. Methods returns root if id is empty. /// The object of the prefab loaded from the prefab. Contains the default values. It's not added to gameplay but deserialized with postLoad and init event fired. API_FUNCTION() SceneObject* GetDefaultInstance(API_PARAM(Ref) const Guid& objectId);