MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / FindActorRecursiveByType

Function FindActorRecursiveByType

Source/Engine/Level/Level.cpp:1798–1813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1796}
1797
1798Actor* FindActorRecursiveByType(Actor* node, const MClass* type, const Tag& tag, bool activeOnly)
1799{
1800 CHECK_RETURN(type, nullptr);
1801 if (activeOnly && !node->GetIsActive())
1802 return nullptr;
1803 if (node->HasTag(tag) && (node->GetClass()->IsSubClassOf(type) || node->GetClass()->HasInterface(type)))
1804 return node;
1805 Actor* result = nullptr;
1806 for (Actor* child : node->Children)
1807 {
1808 result = FindActorRecursiveByType(child, type, tag, activeOnly);
1809 if (result)
1810 break;
1811 }
1812 return result;
1813}
1814
1815void FindActorsRecursive(Actor* node, const Tag& tag, const bool activeOnly, Array<Actor*>& result)
1816{

Callers 1

FindActorMethod · 0.85

Calls 4

HasTagMethod · 0.45
IsSubClassOfMethod · 0.45
GetClassMethod · 0.45
HasInterfaceMethod · 0.45

Tested by

no test coverage detected