Add Crosshair Expansion when OnFire is called.
This commit is contained in:
parent
dc9339ef90
commit
1fb9930791
BIN
Content/UI/WidgetHUD.uasset (Stored with Git LFS)
BIN
Content/UI/WidgetHUD.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -17,4 +17,11 @@ void UPlayerHUDWidget::NativeConstruct()
|
|||
|
||||
void UPlayerHUDWidget::ExpandCrosshair()
|
||||
{
|
||||
if (CrosshairFired)
|
||||
{
|
||||
auto player = Cast<APlayerCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
||||
float playbackSpeed = 1.0 / player->GetCurrentWeapon()->GetWeaponProperties()->WeaponCooldown;
|
||||
|
||||
PlayAnimation(CrosshairFired, 0.0f, 1, EUMGSequencePlayMode::Forward, playbackSpeed);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,4 +46,7 @@ public:
|
|||
|
||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||
UImage* CrosshairImage;
|
||||
|
||||
UPROPERTY(Transient, meta = (BindWidgetAnim))
|
||||
UWidgetAnimation* CrosshairFired;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue