Bugfix BindAction Consuming Left Mouse Input
This commit is contained in:
parent
f7c4fdac3f
commit
0c13de4668
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -32,9 +32,6 @@ void UHoldToInitCombat::BeginPlay()
|
||||
InitCombatWidget->SetVisibility(ESlateVisibility::Hidden);
|
||||
|
||||
ReloadSlider = Cast<URadialSlider>(InitCombatWidget->GetWidgetFromName("ReloadSlider"));
|
||||
|
||||
UInputComponent* PlayerInputComponent = GetWorld()->GetFirstPlayerController()->InputComponent;
|
||||
PlayerInputComponent->BindAction("Click", IE_Pressed, this, &UHoldToInitCombat::OnClickDown);
|
||||
}
|
||||
|
||||
|
||||
@ -60,6 +57,7 @@ void UHoldToInitCombat::TickComponent(float DeltaTime, ELevelTick TickType, FAct
|
||||
|
||||
void UHoldToInitCombat::OnClickDown()
|
||||
{
|
||||
if (Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState())->bIsInCombat) return;
|
||||
if (ReloadTimer > 0.0f) return;
|
||||
if (GunEffect)
|
||||
{
|
||||
|
@ -29,6 +29,9 @@ public:
|
||||
UPROPERTY(EditAnywhere)
|
||||
float ReloadTime = 1.0f;
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void OnClickDown();
|
||||
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
@ -38,7 +41,6 @@ public:
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
private:
|
||||
void OnClickDown();
|
||||
bool bClickDown = false;
|
||||
float ReloadTimer = 0.0f;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user