69 - Fire Weapon Effects
This commit is contained in:
parent
99275f1b71
commit
cd21cd9366
Binary file not shown.
Binary file not shown.
|
@ -58,9 +58,11 @@ void UCombatComponent::OnRep_EquippedWeapon()
|
|||
void UCombatComponent::FireButtonPressed(bool bPressed)
|
||||
{
|
||||
bFireButtonPressed = bPressed;
|
||||
if (EquippedWeapon == nullptr) return;
|
||||
if (Character && bFireButtonPressed)
|
||||
{
|
||||
Character->PlayFireMontage(bAiming);
|
||||
EquippedWeapon->Fire();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,3 +109,11 @@ void AWeapon::ShowPickupWidget(bool bShowWidget)
|
|||
PickupWidget->SetVisibility(bShowWidget);
|
||||
}
|
||||
}
|
||||
|
||||
void AWeapon::Fire()
|
||||
{
|
||||
if (FireAnimation)
|
||||
{
|
||||
WeaponMesh->PlayAnimation(FireAnimation, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ public:
|
|||
AWeapon();
|
||||
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
|
||||
void ShowPickupWidget(bool bShowWidget);
|
||||
void Fire();
|
||||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
@ -63,6 +64,8 @@ private:
|
|||
UPROPERTY(VisibleAnywhere, Category="Weapon Properties")
|
||||
class UWidgetComponent* PickupWidget;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category= "Weapon Properties")
|
||||
class UAnimationAsset* FireAnimation;
|
||||
public:
|
||||
void SetWeaponState(EWeaponState State);
|
||||
FORCEINLINE USphereComponent* GetAreaSphere() const { return AreaSphere; }
|
||||
|
|
Loading…
Reference in New Issue