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

Method FindScript

Source/Engine/Level/Actor.cpp:1629–1655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1627}
1628
1629Script* Actor::FindScript(const MClass* type) const
1630{
1631 CHECK_RETURN(type, nullptr);
1632 if (type->IsInterface())
1633 {
1634 for (const auto script : Scripts)
1635 {
1636 if (script->GetClass()->HasInterface(type))
1637 return script;
1638 }
1639 }
1640 else
1641 {
1642 for (const auto script : Scripts)
1643 {
1644 if (script->GetClass()->IsSubClassOf(type))
1645 return script;
1646 }
1647 }
1648 for (auto child : Children)
1649 {
1650 const auto script = child->FindScript(type);
1651 if (script)
1652 return script;
1653 }
1654 return nullptr;
1655}
1656
1657bool Actor::HasActorInHierarchy(Actor* a) const
1658{

Callers

nothing calls this directly

Calls 3

HasInterfaceMethod · 0.45
GetClassMethod · 0.45
IsSubClassOfMethod · 0.45

Tested by

no test coverage detected