aboutsummaryrefslogtreecommitdiff
path: root/source/GameObject.cpp
diff options
context:
space:
mode:
authorhnOsmium0001 <[email protected]>2022-05-06 19:52:12 -0700
committerhnOsmium0001 <[email protected]>2022-05-06 19:52:12 -0700
commitd98a4159d86406a47628aa58bae9f3308fea4fd0 (patch)
tree4b5ee8aef4a099503801ea731e6fb3c724433cdf /source/GameObject.cpp
parente663fb70fa47764db4576315b78143b6d23ddfa3 (diff)
Improved camera and various cleanups
Diffstat (limited to 'source/GameObject.cpp')
-rw-r--r--source/GameObject.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/GameObject.cpp b/source/GameObject.cpp
index bb86acc..0dccf38 100644
--- a/source/GameObject.cpp
+++ b/source/GameObject.cpp
@@ -124,6 +124,12 @@ GameObject* GameObject::RemoveChild(GameObject* child) {
return nullptr;
}
+void GameObject::RemoveSelfFromParent() {
+ if (mParent) {
+ mParent->RemoveChild(this);
+ }
+}
+
PodVector<GameObject*> GameObject::RemoveAllChildren() {
for (auto& child : mChildren) {
child->SetParent(nullptr);