+1
-1
@@ -136,7 +136,7 @@ namespace AzToolsFramework
|
||||
return m_rootEntityId;
|
||||
}
|
||||
|
||||
bool EntityIdUnderCursor::IsChildEntity() const
|
||||
bool EntityIdUnderCursor::IsPrefabEntity() const
|
||||
{
|
||||
return m_entityId != m_rootEntityId;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,17 @@ namespace AzToolsFramework
|
||||
EntityIdUnderCursor(AZ::EntityId entityId);
|
||||
EntityIdUnderCursor(AZ::EntityId entityId, AZ::EntityId rootEntityId);
|
||||
|
||||
//! Returns the entity id under the cursor (if any).
|
||||
//! @note In the case of no entity id under the cursor, an invalid entity id is returned.
|
||||
AZ::EntityId GetEntityId() const;
|
||||
|
||||
//! Returns the root entity id if the entity id under the cursor is part of a prefab, otherwise returns the entity id.
|
||||
//! @note In the case of no entity id under the cursor, an invalid entity id is returned.
|
||||
AZ::EntityId GetRootEntityId() const;
|
||||
bool IsChildEntity() const;
|
||||
|
||||
//! Returns true if the entity id under the cursor is part of a prefab, otherwise false.
|
||||
//! @note In the case of no entity id under the cursor, true is returned (although consider this behavior undefined).
|
||||
bool IsPrefabEntity() const;
|
||||
|
||||
private:
|
||||
AZ::EntityId m_entityId; //<! The entity id under the cursor.
|
||||
|
||||
+1
-1
@@ -1845,7 +1845,7 @@ namespace AzToolsFramework
|
||||
if (mouseInteraction.m_mouseEvent == ViewportInteraction::MouseEvent::DoubleClick &&
|
||||
mouseInteraction.m_mouseInteraction.m_mouseButtons.Left())
|
||||
{
|
||||
if (entityIdsUnderCursor.IsChildEntity())
|
||||
if (entityIdsUnderCursor.IsPrefabEntity())
|
||||
{
|
||||
auto prefabFocusInterface = AZ::Interface<Prefab::PrefabFocusInterface>::Get();
|
||||
if (prefabFocusInterface)
|
||||
|
||||
Reference in New Issue
Block a user