#include <ActorComponent.h>
ActorComponent is the base class for components that define reusable behavior that can be added to different types of Actors. ActorComponents that have a transform are known as SceneComponents and those that can be rendered are PrimitiveComponents. Components are a special type of Object that Actors can attach to themselves as sub-objects. Components are useful for sharing common behaviors
- See also
- ActorComponent
-
https://docs.unrealengine.com/5.2/en-US/components-in-unreal-engine/
-
USceneComponent
-
UPrimitiveComponent
◆ Activate()
void Karma::UActorComponent::Activate |
( |
bool | bReset = false | ) |
|
|
virtual |
Activates the SceneComponent, should be overridden by native child classes.
- Parameters
-
bReset | - Whether the activation should happen even if ShouldActivate returns false. |
◆ BeginDestroy()
void Karma::UActorComponent::BeginDestroy |
( |
| ) |
|
|
overridevirtual |
◆ BeginPlay()
void Karma::UActorComponent::BeginPlay |
( |
| ) |
|
|
virtual |
Begins Play for the component. Called when the owning Actor begins play or when the component is created if the Actor has already begun play. Actor BeginPlay normally happens right after PostInitializeComponents but can be delayed for networked or child actors. Requires component to be registered and initialized.
Reimplemented in Karma::UPrimitiveComponent.
◆ EndPlay()
Ends gameplay for this component. Called from AActor::EndPlay only if bHasBegunPlay is true
◆ GetOwner()
AActor * Karma::UActorComponent::GetOwner |
( |
| ) |
const |
Follow the Outer chain to get the AActor that 'Owns' this component
◆ HasBeenCreated()
bool Karma::UActorComponent::HasBeenCreated |
( |
| ) |
const |
|
inline |
Indicates that OnCreatedComponent has been called, but OnDestroyedComponent has not yet
◆ HasBeenInitialized()
bool Karma::UActorComponent::HasBeenInitialized |
( |
| ) |
const |
|
inline |
Indicates that InitializeComponent has been called, but UninitializeComponent has not yet
◆ HasBegunPlay()
bool Karma::UActorComponent::HasBegunPlay |
( |
| ) |
const |
|
inline |
Indicates that BeginPlay has been called, but EndPlay has not yet
◆ InitializeComponent()
void Karma::UActorComponent::InitializeComponent |
( |
| ) |
|
|
virtual |
Initializes the component. Occurs at level startup or actor spawn. This is before BeginPlay (Actor or Component). All Components in the level will be Initialized on load before any Actor/Component gets BeginPlay Requires component to be registered, and bWantsInitializeComponent to be true.
◆ IsActive()
bool Karma::UActorComponent::IsActive |
( |
| ) |
const |
|
inline |
Returns whether the component is active or not
- Returns
- - The active state of the component.
◆ IsRegistered()
bool Karma::UActorComponent::IsRegistered |
( |
| ) |
const |
|
inline |
See if this component is currently registered
◆ OnComponentCreated()
void Karma::UActorComponent::OnComponentCreated |
( |
| ) |
|
|
virtual |
Called when a component is created (not loaded). This can happen in the editor or during gameplay
◆ OnComponentDestroyed()
void Karma::UActorComponent::OnComponentDestroyed |
( |
bool | bDestroyingHierarchy | ) |
|
|
virtual |
Called when a component is destroyed
- Parameters
-
bDestroyingHierarchy | - True if the entire component hierarchy is being torn down, allows avoiding expensive operations |
◆ SetActiveFlag()
void Karma::UActorComponent::SetActiveFlag |
( |
const bool | bNewIsActive | ) |
|
Sets the value of bIsActive without causing other side effects to this instance.
Activate, Deactivate, and SetActive are preferred in most cases because they respect virtual behavior.
◆ ShouldActivate()
bool Karma::UActorComponent::ShouldActivate |
( |
| ) |
const |
|
protectedvirtual |
Return true if this component is in a state where it can be activated normally.
◆ TickComponent()
void Karma::UActorComponent::TickComponent |
( |
float | deltaTime | ) |
|
|
virtual |
Function called every frame on this ActorComponent. Override this function to implement custom logic to be executed every frame. Only executes if the component is registered, and also PrimaryComponentTick.bCanEverTick must be set to true.
- Parameters
-
deltaTime | - The time since the last tick. Rest of the params shall be functionla later |
TickType | - The kind of tick this is, for example, are we paused, or 'simulating' in the editor |
ThisTickFunction | - Internal tick function struct that caused this to run |
◆ UninitializeComponent()
void Karma::UActorComponent::UninitializeComponent |
( |
| ) |
|
|
virtual |
Handle this component being Uninitialized.
- See also
- Called from AActor::EndPlay only if bHasBeenInitialized is true
◆ m_bAutoActivate
uint8_t Karma::UActorComponent::m_bAutoActivate |
Whether the component is activated at creation or must be explicitly activated.
◆ m_bRegistered
uint8_t Karma::UActorComponent::m_bRegistered |
|
protected |
Indicates if this ActorComponent is currently registered with a scene.
◆ m_bWantsInitializeComponent
uint8_t Karma::UActorComponent::m_bWantsInitializeComponent |
If true, we call the virtual InitializeComponent
◆ m_CreationMethod
EComponentCreationMethod Karma::UActorComponent::m_CreationMethod |
Describes how a component instance will be created
The documentation for this class was generated from the following files:
- Karma/src/Karma/GameFramework/ActorComponent.h
- Karma/src/Karma/GameFramework/ActorComponent.cpp