Made AmmunitionHUD into TextFieldReader which reads any component field on a parent and updates a Text component with the value!

This commit is contained in:
2016-03-03 01:35:32 +01:00
parent 13546aa3fc
commit 0e8b97dbba
16 changed files with 174 additions and 117 deletions
+12
View File
@@ -34,6 +34,18 @@ EntityWrapper EntityWrapper::Parent()
}
}
EntityWrapper EntityWrapper::FirstParentByName(const std::string& parentEntityName)
{
EntityWrapper entity = *this;
while (entity.Parent().Valid()) {
entity = entity.Parent();
if (entity.Name() == parentEntityName) {
return entity;
}
}
return EntityWrapper::Invalid;
}
EntityWrapper EntityWrapper::FirstChildByName(const std::string& name)
{
return firstChildByNameRecursive(name, this->ID);