Removed AnimationOffset and improved BlendTree
This commit is contained in:
@@ -39,6 +39,31 @@ EntityWrapper EntityWrapper::FirstChildByName(const std::string& name)
|
||||
return firstChildByNameRecursive(name, this->ID);
|
||||
}
|
||||
|
||||
|
||||
EntityWrapper EntityWrapper::FirstLevelChildByName(const std::string& name)
|
||||
{
|
||||
EntityID parent = this->ID;
|
||||
if (!this->World->ValidEntity(parent)) {
|
||||
return EntityWrapper::Invalid;
|
||||
}
|
||||
|
||||
auto itPair = this->World->GetChildren(parent);
|
||||
if (itPair.first == itPair.second) {
|
||||
return EntityWrapper::Invalid;
|
||||
}
|
||||
|
||||
for (auto it = itPair.first; it != itPair.second; ++it) {
|
||||
std::string itName = this->World->GetName(it->second);
|
||||
if (itName == name) {
|
||||
return EntityWrapper(this->World, it->second);
|
||||
} else if (it->second != EntityID_Invalid) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return EntityWrapper::Invalid;
|
||||
}
|
||||
|
||||
EntityWrapper EntityWrapper::FirstParentWithComponent(const std::string& componentType)
|
||||
{
|
||||
EntityWrapper entity = *this;
|
||||
|
||||
Reference in New Issue
Block a user