Added implementation for various GameObject functions

This commit is contained in:
Kah Wei 2022-09-13 18:42:43 +08:00
parent 073cf902a9
commit 9c833da88a
1 changed files with 6 additions and 5 deletions

View File

@ -28,7 +28,7 @@ namespace SHADE
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
GameObject GameObject::Create() GameObject GameObject::Create()
{ {
throw gcnew System::NotImplementedException(); return GameObject(SHEntityManager::CreateEntity());
} }
void GameObject::Destroy(GameObject obj) void GameObject::Destroy(GameObject obj)
@ -47,11 +47,12 @@ namespace SHADE
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
System::String^ GameObject::Name::get() System::String^ GameObject::Name::get()
{ {
throw gcnew System::NotImplementedException(); return Convert::ToCLI(GetNativeEntity().name);
} }
bool GameObject::IsActiveSelf::get() bool GameObject::IsActiveSelf::get()
{ {
throw gcnew System::NotImplementedException(); return GetNativeEntity().isActive;
} }
bool GameObject::IsActiveInHierarchy::get() bool GameObject::IsActiveInHierarchy::get()
{ {
@ -63,11 +64,11 @@ namespace SHADE
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
void GameObject::SetName(System::String^ name) void GameObject::SetName(System::String^ name)
{ {
throw gcnew System::NotImplementedException(); GetNativeEntity().name = Convert::ToNative(name);
} }
void GameObject::SetActive(bool active) void GameObject::SetActive(bool active)
{ {
throw gcnew System::NotImplementedException(); GetNativeEntity().isActive = active;
} }
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/