Base class for all components that can be attached to an Actor. Components define behavior or functionality and are updated each frame. They can respond to events such as start, update, end, or world transform changes.
More...
#include <Component.h>
|
| Component (Actor *pOwner, int pUpdateOrder=100) |
| Constructor for Component.
|
|
virtual | ~Component () |
|
virtual void | OnStart () |
| Called when the component is initialized (during actor start). This can be used to perform any setup operations for the component.
|
|
virtual void | Update () |
| Called every frame to update the component. This can be used to perform actions that need to be updated periodically.
|
|
virtual void | OnEnd () |
| Called when the component is about to be destroyed (during actor destruction). This can be used to clean up or release any resources.
|
|
virtual void | OnUpdateWorldTrandform () |
| Called when the world transform of the actor is updated. This allows the component to react to changes in the actor's world transform.
|
|
void | SetActive (bool isActive) |
| Sets the active status of the component.
|
|
void | SetOwner (Actor *pOwner) |
| Sets the actor that owns this component.
|
|
int | GetUpdateOrder () const |
| Returns the update order of the component. Components with lower update orders are updated first.
|
|
Actor * | GetOwner () const |
| Returns the actor that owns this component.
|
|
|
Actor * | mOwner = nullptr |
| The actor that owns this component.
|
|
Base class for all components that can be attached to an Actor. Components define behavior or functionality and are updated each frame. They can respond to events such as start, update, end, or world transform changes.
◆ Component()
Component::Component |
( |
Actor * | pOwner, |
|
|
int | pUpdateOrder = 100 ) |
Constructor for Component.
- Parameters
-
pOwner | The actor that owns this component. |
pUpdateOrder | The update order priority for the component (default: 100). |
◆ ~Component()
virtual Component::~Component |
( |
| ) |
|
|
inlinevirtual |
◆ GetOwner()
Actor * Component::GetOwner |
( |
| ) |
const |
Returns the actor that owns this component.
- Returns
- The actor that owns this component.
◆ GetUpdateOrder()
int Component::GetUpdateOrder |
( |
| ) |
const |
Returns the update order of the component. Components with lower update orders are updated first.
- Returns
- The update order of the component.
◆ OnEnd()
virtual void Component::OnEnd |
( |
| ) |
|
|
inlinevirtual |
Called when the component is about to be destroyed (during actor destruction). This can be used to clean up or release any resources.
Reimplemented in ColliderComponent, and RenderComponent.
◆ OnStart()
virtual void Component::OnStart |
( |
| ) |
|
|
inlinevirtual |
Called when the component is initialized (during actor start). This can be used to perform any setup operations for the component.
Reimplemented in ColliderComponent, and RenderComponent.
◆ OnUpdateWorldTrandform()
virtual void Component::OnUpdateWorldTrandform |
( |
| ) |
|
|
inlinevirtual |
Called when the world transform of the actor is updated. This allows the component to react to changes in the actor's world transform.
◆ SetActive()
void Component::SetActive |
( |
bool | isActive | ) |
|
Sets the active status of the component.
- Parameters
-
isActive | Whether the component should be active or not. |
◆ SetOwner()
void Component::SetOwner |
( |
Actor * | pOwner | ) |
|
Sets the actor that owns this component.
- Parameters
-
pOwner | The actor to assign as the owner of this component. |
◆ Update()
virtual void Component::Update |
( |
| ) |
|
|
inlinevirtual |
◆ mOwner
Actor* Component::mOwner = nullptr |
|
protected |
The actor that owns this component.
The documentation for this class was generated from the following files: