From cde94efdd44553f3f6575ce84b44c6799e1a1425 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Fri, 6 May 2022 19:52:12 -0700 Subject: Changeset: 22 Improved camera and various cleanups --- source/GameObject.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/GameObject.cpp') 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::RemoveAllChildren() { for (auto& child : mChildren) { child->SetParent(nullptr); -- cgit v1.2.3-70-g09d2