|
My Project
|
Base class for all components in the engine. Components define behavior that can be attached to a GameObject. More...
#include <Component.hpp>
Public Member Functions | |
| virtual | ~Component ()=default |
| Virtual destructor to allow proper cleanup of derived components. | |
| virtual void | Start () |
| Called once when the component is first initialized. | |
| virtual void | Update (float dt) |
| Called every frame to update the component logic. | |
| virtual void | OnDestroy () |
| Called when the component is destroyed or removed from the GameObject. | |
| virtual std::string | GetTypeName () const =0 |
| Returns the name of the component type. Useful for debugging, logging, or editor systems. | |
Public Attributes | |
| GameObject * | gameObject = nullptr |
| Pointer to the GameObject that owns this component. | |
Protected Member Functions | |
| Component ()=default | |
| Protected constructor to prevent direct instantiation of the base class. | |
Base class for all components in the engine. Components define behavior that can be attached to a GameObject.
|
virtualdefault |
Virtual destructor to allow proper cleanup of derived components.
|
protecteddefault |
Protected constructor to prevent direct instantiation of the base class.
|
pure virtual |
Returns the name of the component type. Useful for debugging, logging, or editor systems.
Implemented in Engine::MeshComponent, Engine::RigidBodyComponent, Engine::TextureComponent, and Engine::Transform.
|
inlinevirtual |
Called when the component is destroyed or removed from the GameObject.
Reimplemented in Engine::AssetComponent, Engine::MeshComponent, Engine::RigidBodyComponent, and Engine::TextureComponent.
|
inlinevirtual |
Called once when the component is first initialized.
Reimplemented in Engine::AssetComponent, Engine::MeshComponent, Engine::RigidBodyComponent, and Engine::TextureComponent.
|
inlinevirtual |
Called every frame to update the component logic.
| dt | Delta time between frames |
Reimplemented in Engine::AssetComponent, Engine::MeshComponent, Engine::RigidBodyComponent, Engine::TextureComponent, and Engine::Transform.
| GameObject* Engine::Component::gameObject = nullptr |
Pointer to the GameObject that owns this component.