Merge pull request #4040 from aws-lumberyard-dev/automation_improv
Added EntityExists for automation
This commit is contained in:
@@ -414,6 +414,9 @@ namespace AzToolsFramework
|
||||
//! Gets an existing entity id from a known id.
|
||||
virtual AZ::EntityId GetExistingEntity(AZ::u64 id) = 0;
|
||||
|
||||
//! Returns if an entity with the given id exists
|
||||
virtual bool EntityExists(AZ::EntityId id) = 0;
|
||||
|
||||
/*!
|
||||
* Delete all currently-selected entities.
|
||||
*/
|
||||
|
||||
@@ -378,6 +378,7 @@ namespace AzToolsFramework
|
||||
->Event("CreateNewEntityAtPosition", &ToolsApplicationRequests::CreateNewEntityAtPosition)
|
||||
->Event("GetCurrentLevelEntityId", &ToolsApplicationRequests::GetCurrentLevelEntityId)
|
||||
->Event("GetExistingEntity", &ToolsApplicationRequests::GetExistingEntity)
|
||||
->Event("EntityExists", &ToolsApplicationRequests::EntityExists)
|
||||
->Event("DeleteEntityById", &ToolsApplicationRequests::DeleteEntityById)
|
||||
->Event("DeleteEntities", &ToolsApplicationRequests::DeleteEntities)
|
||||
->Event("DeleteEntityAndAllDescendants", &ToolsApplicationRequests::DeleteEntityAndAllDescendants)
|
||||
@@ -783,6 +784,11 @@ namespace AzToolsFramework
|
||||
return AZ::EntityId{id};
|
||||
}
|
||||
|
||||
bool ToolsApplication::EntityExists(AZ::EntityId id)
|
||||
{
|
||||
return FindEntity(id) != nullptr;
|
||||
}
|
||||
|
||||
void ToolsApplication::DeleteSelected()
|
||||
{
|
||||
if (IsPrefabSystemEnabled())
|
||||
|
||||
@@ -115,6 +115,7 @@ namespace AzToolsFramework
|
||||
AZ::EntityId CreateNewEntity(AZ::EntityId parentId = AZ::EntityId()) override;
|
||||
AZ::EntityId CreateNewEntityAtPosition(const AZ::Vector3& pos, AZ::EntityId parentId = AZ::EntityId()) override;
|
||||
AZ::EntityId GetExistingEntity(AZ::u64 id) override;
|
||||
bool EntityExists(AZ::EntityId id) override;
|
||||
void DeleteSelected() override;
|
||||
void DeleteEntityById(AZ::EntityId entityId) override;
|
||||
void DeleteEntities(const EntityIdList& entities) override;
|
||||
|
||||
Reference in New Issue
Block a user