From c854b657c1dceab483c40e8899c22bb250425b8d Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 23 Jan 2023 23:43:16 +0100 Subject: [PATCH] Add actor virtual functions `OnDebugDraw`/`OnDebugDrawSelected`/`OnEnable`/`OnDisable` to override in scripting --- Source/Engine/Level/Actor.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index 3e8d5232f..e68f5ee17 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -623,7 +623,6 @@ public: API_PROPERTY() BoundingBox GetBoxWithChildren() const; #if USE_EDITOR - /// /// Gets actor bounding box (single actor, no children included) for editor tools. /// @@ -633,7 +632,6 @@ public: /// Gets actor bounding box of the actor including all child actors for editor tools. /// API_PROPERTY() BoundingBox GetEditorBoxChildren() const; - #endif /// @@ -665,17 +663,15 @@ public: virtual void Draw(RenderContextBatch& renderContextBatch); #if USE_EDITOR - /// /// Draws debug shapes for the actor and all child scripts. /// - virtual void OnDebugDraw(); + API_FUNCTION() virtual void OnDebugDraw(); /// /// Draws debug shapes for the selected actor and all child scripts. /// - virtual void OnDebugDrawSelected(); - + API_FUNCTION() virtual void OnDebugDrawSelected(); #endif public: @@ -812,9 +808,7 @@ public: if (action(this, args...)) { for (int32 i = 0; i < Children.Count(); i++) - { Children[i]->TreeExecute(action, args...); - } } } @@ -829,9 +823,7 @@ public: void TreeExecuteChildren(Function& action, Params ... args) { for (int32 i = 0; i < Children.Count(); i++) - { Children[i]->TreeExecute(action, args...); - } } public: @@ -897,12 +889,12 @@ public: /// /// Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio). /// - virtual void OnEnable(); + API_FUNCTION() virtual void OnEnable(); /// /// Called when actor gets removed from game systems. Occurs on EndPlay event or when actor gets inactivated in hierarchy. Use this event to unregister object from other game system (eg. audio). /// - virtual void OnDisable(); + API_FUNCTION() virtual void OnDisable(); /// /// Called when actor parent gets changed.