From 69e625014d98fee061863e1d2e50482ff475b058 Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Tue, 1 Nov 2022 15:25:19 +0800 Subject: [PATCH] Added EntityID retrieval from GameObject --- SHADE_Managed/src/Engine/GameObject.cxx | 4 ++++ SHADE_Managed/src/Engine/GameObject.hxx | 7 +++++++ TempScriptsFolder/PhysicsTest.cs | 1 - 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/SHADE_Managed/src/Engine/GameObject.cxx b/SHADE_Managed/src/Engine/GameObject.cxx index 55d53d68..f4c16f4f 100644 --- a/SHADE_Managed/src/Engine/GameObject.cxx +++ b/SHADE_Managed/src/Engine/GameObject.cxx @@ -72,6 +72,10 @@ namespace SHADE } return node->IsActive(); } + Entity GameObject::EntityId::get() + { + return entity; + } /*---------------------------------------------------------------------------------*/ /* GameObject Property Functions */ diff --git a/SHADE_Managed/src/Engine/GameObject.hxx b/SHADE_Managed/src/Engine/GameObject.hxx index 723d9cec..8eaa67f3 100644 --- a/SHADE_Managed/src/Engine/GameObject.hxx +++ b/SHADE_Managed/src/Engine/GameObject.hxx @@ -86,6 +86,13 @@ namespace SHADE { bool get(); } + /// + /// Native Entity ID value for this GameObject. + /// + property Entity EntityId + { + Entity get(); + } /*-----------------------------------------------------------------------------*/ /* GameObject Property Functions */ diff --git a/TempScriptsFolder/PhysicsTest.cs b/TempScriptsFolder/PhysicsTest.cs index c2f707cf..cc01615d 100644 --- a/TempScriptsFolder/PhysicsTest.cs +++ b/TempScriptsFolder/PhysicsTest.cs @@ -38,7 +38,6 @@ public class PhysicsTest : Script RigidBody.AddForce(Force); Debug.Log($"Jump!"); } - Debug.Log($"{Transform.LocalPosition.y}"); } protected override void fixedUpdate()