Components now use InitializeComponent instead of BeginPlay.
This commit is contained in:
parent
13172b3b60
commit
c50c9c6bf7
@ -19,16 +19,25 @@ UComboManagerComponent::UComboManagerComponent()
|
|||||||
this->PrimaryComponentTick.bStartWithTickEnabled = false;
|
this->PrimaryComponentTick.bStartWithTickEnabled = false;
|
||||||
this->PrimaryComponentTick.bTickEvenWhenPaused = false;
|
this->PrimaryComponentTick.bTickEvenWhenPaused = false;
|
||||||
this->PrimaryComponentTick.bCanEverTick = false;
|
this->PrimaryComponentTick.bCanEverTick = false;
|
||||||
|
|
||||||
|
this->bWantsInitializeComponent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UComboManagerComponent::BeginPlay()
|
void UComboManagerComponent::InitializeComponent()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::InitializeComponent();
|
||||||
|
|
||||||
checkf(this->ComboGraph, TEXT("No combo graph is set for %s in actor %s"), *UComboManagerComponent::StaticClass()->GetName(), *this->GetOwner()->GetName());
|
checkf(this->ComboGraph, TEXT("No combo graph is set for %s in actor %s"), *UComboManagerComponent::StaticClass()->GetName(), *this->GetOwner()->GetName());
|
||||||
this->ActiveNode = this->ComboGraph->StartNode;
|
this->ActiveNode = this->ComboGraph->StartNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UComboManagerComponent::SetComboGraph(const UComboActionGraph *Graph)
|
||||||
|
{
|
||||||
|
this->ComboGraph = Graph;
|
||||||
|
this->ActiveNode = this->ComboGraph->StartNode;
|
||||||
|
this->PreviousNode = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void UComboManagerComponent::HandleComboInput(const UComboInputAsset *Input, const EComboActionTriggerEvent &TriggerEvent)
|
void UComboManagerComponent::HandleComboInput(const UComboInputAsset *Input, const EComboActionTriggerEvent &TriggerEvent)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,9 +12,14 @@
|
|||||||
DEFINE_LOG_CATEGORY(LogInputBufferComponent);
|
DEFINE_LOG_CATEGORY(LogInputBufferComponent);
|
||||||
|
|
||||||
|
|
||||||
void UInputBufferComponent::BeginPlay()
|
UInputBufferComponent::UInputBufferComponent()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
this->bWantsInitializeComponent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UInputBufferComponent::InitializeComponent()
|
||||||
|
{
|
||||||
|
Super::InitializeComponent();
|
||||||
|
|
||||||
if (APlayerController *PlayerController = UGameplayStatics::GetPlayerController(this, 0))
|
if (APlayerController *PlayerController = UGameplayStatics::GetPlayerController(this, 0))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,8 +42,10 @@ class COMBOINPUT_API UComboManagerComponent : public UActorComponent
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UComboManagerComponent();
|
UComboManagerComponent();
|
||||||
|
virtual void InitializeComponent() override;
|
||||||
|
|
||||||
virtual void BeginPlay() override;
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void SetComboGraph(const class UComboActionGraph *Graph);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void HandleComboInput(const class UComboInputAsset *Input, const EComboActionTriggerEvent &TriggerEvent);
|
void HandleComboInput(const class UComboInputAsset *Input, const EComboActionTriggerEvent &TriggerEvent);
|
||||||
|
|||||||
@ -21,7 +21,8 @@ class COMBOINPUT_API UInputBufferComponent : public UEnhancedInputComponent
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void BeginPlay() override;
|
UInputBufferComponent();
|
||||||
|
virtual void InitializeComponent() override;
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void LockComboInput(const class UComboInputAsset *Input);
|
void LockComboInput(const class UComboInputAsset *Input);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user