Update Character to Trigger Pistol Reload Animation
This commit is contained in:
parent
eab0b2b18b
commit
5ac9e3fda5
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset
(Stored with Git LFS)
Binary file not shown.
@ -54,7 +54,15 @@ void AEndlessVendettaCharacter::DecrementRestrictedBoundsCount()
|
|||||||
|
|
||||||
void AEndlessVendettaCharacter::ReloadAnimationComplete()
|
void AEndlessVendettaCharacter::ReloadAnimationComplete()
|
||||||
{
|
{
|
||||||
bIsReloading = false;
|
if (IsValid(PrimaryWeapon))
|
||||||
|
{
|
||||||
|
PrimaryWeapon->WeaponReload();
|
||||||
|
}
|
||||||
|
if (IsValid(SecondaryWeapon))
|
||||||
|
{
|
||||||
|
if (!bIsReloading) return;
|
||||||
|
SecondaryWeapon->WeaponReload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AEndlessVendettaCharacter::SetOverlayState(const EOverlayState OverlayState) const
|
void AEndlessVendettaCharacter::SetOverlayState(const EOverlayState OverlayState) const
|
||||||
@ -639,12 +647,15 @@ void AEndlessVendettaCharacter::GunReload()
|
|||||||
if (InPauseMenu) return;
|
if (InPauseMenu) return;
|
||||||
if (IsValid(PrimaryWeapon))
|
if (IsValid(PrimaryWeapon))
|
||||||
{
|
{
|
||||||
|
if (PrimaryWeapon->currentAmmoCount == PrimaryWeapon->MagazineSize) return;
|
||||||
PrimaryWeapon->ReloadTimer();
|
PrimaryWeapon->ReloadTimer();
|
||||||
bIsReloading = true;
|
bIsReloading = true;
|
||||||
}
|
}
|
||||||
if (IsValid(SecondaryWeapon))
|
else if (IsValid(SecondaryWeapon))
|
||||||
{
|
{
|
||||||
SecondaryWeapon->ReloadTimer();
|
if (SecondaryWeapon->currentAmmoCount == SecondaryWeapon->MagazineSize) return;
|
||||||
|
StartReload.Broadcast();
|
||||||
|
SecondaryWeapon->ShowReloadingWidget();
|
||||||
bIsReloading = true;
|
bIsReloading = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,10 @@ public:
|
|||||||
void IncrementRestrictedBoundsCount();
|
void IncrementRestrictedBoundsCount();
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void DecrementRestrictedBoundsCount();
|
void DecrementRestrictedBoundsCount();
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FReloadAnimationComplete);
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FStartReload);
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintAssignable, Category = "Weapon")
|
||||||
|
FStartReload StartReload;
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Weapon")
|
UFUNCTION(BlueprintCallable, Category = "Weapon")
|
||||||
void ReloadAnimationComplete();
|
void ReloadAnimationComplete();
|
||||||
|
@ -43,8 +43,6 @@ protected:
|
|||||||
float recoilResultPitch = 0;
|
float recoilResultPitch = 0;
|
||||||
float recoilResultYaw = 0;
|
float recoilResultYaw = 0;
|
||||||
|
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
|
||||||
void ShowReloadingWidget();
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
void HideReloadingWidget();
|
void HideReloadingWidget();
|
||||||
@ -177,6 +175,9 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetupSilencerAttachment(UStaticMesh* SilencerMesh);
|
void SetupSilencerAttachment(UStaticMesh* SilencerMesh);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
|
void ShowReloadingWidget();
|
||||||
|
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
void ShowNeedReloadUI();
|
void ShowNeedReloadUI();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user