From 300647afa6e7b09b0b21a65834bdb387a8b70c53 Mon Sep 17 00:00:00 2001 From: Xiao Qi Date: Fri, 25 Nov 2022 12:24:13 +0800 Subject: [PATCH 1/2] Stopped camera from running when editor is in pause --- SHADE_Engine/src/Camera/SHCameraSystem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SHADE_Engine/src/Camera/SHCameraSystem.h b/SHADE_Engine/src/Camera/SHCameraSystem.h index ee93f9a9..db680adb 100644 --- a/SHADE_Engine/src/Camera/SHCameraSystem.h +++ b/SHADE_Engine/src/Camera/SHCameraSystem.h @@ -41,7 +41,7 @@ namespace SHADE class SH_API CameraSystemUpdate final: public SHSystemRoutine { public: - CameraSystemUpdate() : SHSystemRoutine("Camera System Update", true) {}; + CameraSystemUpdate() : SHSystemRoutine("Camera System Update", false) {}; virtual void Execute(double dt)noexcept override final; }; friend class CameraSystemUpdate; From 73d0486fc81230ca76ceb7945099707afc46690d Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Fri, 25 Nov 2022 13:05:35 +0800 Subject: [PATCH 2/2] Added support for enabling and disabling components --- SHADE_Managed/src/Components/Component.cxx | 8 ++++++++ SHADE_Managed/src/Components/Component.hxx | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/SHADE_Managed/src/Components/Component.cxx b/SHADE_Managed/src/Components/Component.cxx index 7f56fad3..91fb73bb 100644 --- a/SHADE_Managed/src/Components/Component.cxx +++ b/SHADE_Managed/src/Components/Component.cxx @@ -22,6 +22,14 @@ of DigiPen Institute of Technology is prohibited. namespace SHADE { + /*---------------------------------------------------------------------------------*/ + /* Properties */ + /*---------------------------------------------------------------------------------*/ + GameObject BaseComponent::Owner::get() + { + return owner; + } + /*---------------------------------------------------------------------------------*/ /* Component Access Functions */ /*---------------------------------------------------------------------------------*/ diff --git a/SHADE_Managed/src/Components/Component.hxx b/SHADE_Managed/src/Components/Component.hxx index a1d83eaf..9f3702e1 100644 --- a/SHADE_Managed/src/Components/Component.hxx +++ b/SHADE_Managed/src/Components/Component.hxx @@ -36,7 +36,7 @@ namespace SHADE /// property GameObject Owner { - GameObject get() { return owner; } + GameObject get(); } /*-----------------------------------------------------------------------------*/ @@ -166,6 +166,19 @@ namespace SHADE template public ref class Component : public BaseComponent { + public: + /*-----------------------------------------------------------------------------*/ + /* Properties */ + /*-----------------------------------------------------------------------------*/ + /// + /// Whether or not the Component is active and being updated by the engine. + /// + property bool Enabled + { + bool get() { return GetNativeComponent()->isActive; } + void set(bool value) { GetNativeComponent()->isActive = value; } + } + internal: /*-----------------------------------------------------------------------------*/ /* Type Definitions */