| 1627 | } |
| 1628 | |
| 1629 | Script* 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 | |
| 1657 | bool Actor::HasActorInHierarchy(Actor* a) const |
| 1658 | { |
nothing calls this directly
no test coverage detected