![]() |
ezEngine
Release 25.03
|
Certain components may delete themselves or their owner when they are finished with their main purpose. More...
#include <Declarations.h>
Public Types | |
enum | Enum : StorageType { None, DeleteComponent, DeleteGameObject, Default = None } |
using | StorageType = ezUInt8 |
Static Public Member Functions | |
static void | HandleFinishedAction (ezComponent *pComponent, ezOnComponentFinishedAction::Enum action) |
Call this when a component is 'finished' with its work. More... | |
static void | HandleDeleteObjectMsg (ezMsgDeleteGameObject &ref_msg, ezEnum< ezOnComponentFinishedAction > &ref_action) |
Call this function in a message handler for ezMsgDeleteGameObject messages. More... | |
Certain components may delete themselves or their owner when they are finished with their main purpose.
enum ezOnComponentFinishedAction::Enum : StorageType |
|
static |
Call this function in a message handler for ezMsgDeleteGameObject messages.
This is needed to coordinate object deletion across multiple components that use the ezOnComponentFinishedAction mechanism. Depending on the state of this component, the function will either execute the object deletion, or delay it, until its own work is done.
|
static |
Call this when a component is 'finished' with its work.
Pass in the desired action (usually configured by the user) and the 'this' pointer of the component. The helper function will delete this component and maybe also attempt to delete the entire object. For that it will coordinate with other components, and delay the object deletion, if necessary, until the last component has finished it's work.