Renamed a function and improved comments

This commit is contained in:
srikappa
2021-05-28 02:29:09 -07:00
parent be6cee806d
commit 55e1da64bb
5 changed files with 9 additions and 7 deletions
@@ -48,7 +48,6 @@ namespace AzToolsFramework
using EntityAliasOptionalReference = AZStd::optional<AZStd::reference_wrapper<EntityAlias>>;
using InstanceOptionalReference = AZStd::optional<AZStd::reference_wrapper<Instance>>;
using InstanceOptionalConstReference = AZStd::optional<AZStd::reference_wrapper<const Instance>>;
using InstancePtrOptionalReference = AZStd::optional<AZStd::reference_wrapper<AZStd::unique_ptr<Instance>>>;
using InstanceSet = AZStd::unordered_set<Instance*>;
using InstanceSetConstReference = AZStd::optional<AZStd::reference_wrapper<const InstanceSet>>;
@@ -990,7 +990,7 @@ namespace AzToolsFramework
return AZ::Success();
}
PrefabOperationResult PrefabPublicHandler::DetachPrefabFromParent(const AZ::EntityId& entityId)
PrefabOperationResult PrefabPublicHandler::DetachPrefab(const AZ::EntityId& entityId)
{
if (!entityId.IsValid())
{
@@ -64,7 +64,7 @@ namespace AzToolsFramework
PrefabOperationResult DeleteEntitiesAndAllDescendantsInInstance(const EntityIdList& entityIds) override;
PrefabOperationResult DuplicateEntitiesInInstance(const EntityIdList& entityIds) override;
PrefabOperationResult DetachPrefabFromParent(const AZ::EntityId& entityId) override;
PrefabOperationResult DetachPrefab(const AZ::EntityId& entityId) override;
private:
PrefabOperationResult DeleteFromInstance(const EntityIdList& entityIds, bool deleteDescendants);
@@ -152,12 +152,15 @@ namespace AzToolsFramework
virtual PrefabOperationResult DuplicateEntitiesInInstance(const EntityIdList& entityIds) = 0;
/**
* Detaches target container entity's owning instance from its parent instance.
* If the entity id is a container entity id, detaches the prefab instance corresponding to it. This includes converting
* the container entity into a regular entity and putting it under the parent prefab, removing the link between this
* instance and the parent, removing links between this instance and it's nested instances, adding entities directly
* owned by this instance under the parent instance.
* Bails if the entity is not a container entity or belongs to the level prefab instance.
* @param entityId The container entity whose instance to detach.
* @param entityId The container entity id of the instance to detach.
* @return An outcome object; on failure, it comes with an error message detailing the cause of the error.
*/
virtual PrefabOperationResult DetachPrefabFromParent(const AZ::EntityId& entityId) = 0;
virtual PrefabOperationResult DetachPrefab(const AZ::EntityId& entityId) = 0;
};
} // namespace Prefab
@@ -413,7 +413,7 @@ namespace AzToolsFramework
void PrefabIntegrationManager::ContextMenu_DetachPrefab(AZ::EntityId containerEntity)
{
PrefabOperationResult detachPrefabResult =
s_prefabPublicInterface->DetachPrefabFromParent(containerEntity);
s_prefabPublicInterface->DetachPrefab(containerEntity);
if (!detachPrefabResult.IsSuccess())
{