Merge branch 'findactor' of https://github.com/Tryibion/FlaxEngine into Tryibion-findactor

This commit is contained in:
Wojtek Figat
2023-06-09 13:45:49 +02:00
6 changed files with 84 additions and 0 deletions

View File

@@ -1524,6 +1524,16 @@ Actor* Level::FindActor(const MClass* type)
return result;
}
Actor* Level::FindActor(const MClass* type, const StringView& name)
{
CHECK_RETURN(type, nullptr);
Actor* result = nullptr;
ScopeLock lock(ScenesLock);
for (int32 i = 0; result == nullptr && i < Scenes.Count(); i++)
result = Scenes[i]->FindActor(type, name);
return result;
}
Script* Level::FindScript(const MClass* type)
{
CHECK_RETURN(type, nullptr);