ComboManagerComponent now detects if it's in the PlayerController, instead of the PlayerCharacter, since that makes a bit more sense.
This commit is contained in:
parent
cd4708449f
commit
90af002272
@ -24,15 +24,14 @@ void UComboManagerComponent::BeginPlay()
|
|||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
|
|
||||||
// If this component's owner is the player character, attach it to the subsystem.
|
// If this component's owner is the player character or controller, attach it to the subsystem.
|
||||||
ACharacter *PlayerCharacter = UGameplayStatics::GetPlayerCharacter(this, 0);
|
APlayerController *PlayerController = UGameplayStatics::GetPlayerController(this, 0);
|
||||||
if (this->GetOwner() == PlayerCharacter)
|
if (this->GetOwner() == PlayerController)
|
||||||
{
|
{
|
||||||
APlayerController *Controller = UGameplayStatics::GetPlayerController(this, 0);
|
UEnhancedInputComponent *InputComponent = Cast<UEnhancedInputComponent>(PlayerController->InputComponent);
|
||||||
UEnhancedInputComponent *InputComponent = Cast<UEnhancedInputComponent>(Controller->InputComponent);
|
checkf(InputComponent, TEXT("Discovered player input component is not of type %s."), *UEnhancedInputComponent::StaticClass()->GetName());
|
||||||
checkf(Controller, TEXT("Discovered controller is not a %s type."), *UEnhancedInputComponent::StaticClass()->GetName());
|
|
||||||
|
|
||||||
UInputBufferLocalPlayerSubsystem *InputBufferSubsystem = Controller->GetLocalPlayer()->GetSubsystem<UInputBufferLocalPlayerSubsystem>();
|
UInputBufferLocalPlayerSubsystem *InputBufferSubsystem = PlayerController->GetLocalPlayer()->GetSubsystem<UInputBufferLocalPlayerSubsystem>();
|
||||||
InputBufferSubsystem->AttachComboManager(this, InputComponent);
|
InputBufferSubsystem->AttachComboManager(this, InputComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user