Simplify code #1949
This commit is contained in:
@@ -1358,16 +1358,11 @@ bool Actor::IsPrefabRoot() const
|
||||
|
||||
Actor* Actor::GetPrefabRoot()
|
||||
{
|
||||
if (!this->HasPrefabLink())
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!HasPrefabLink())
|
||||
return nullptr;
|
||||
Actor* result = this;
|
||||
while (!result == NULL && !result->IsPrefabRoot())
|
||||
{
|
||||
while (result && !result->IsPrefabRoot())
|
||||
result = result->GetParent();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -794,7 +794,7 @@ public:
|
||||
{
|
||||
return (T*)FindActor(T::GetStaticClass(), name);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Tries to find the actor of the given type and tag in this actor hierarchy (checks this actor and all children hierarchy).
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user