Add new Weapon HUD UI
This commit is contained in:
parent
4ab591e4b9
commit
a402de0781
BIN
Content/UI/WidgetHUD.uasset (Stored with Git LFS)
BIN
Content/UI/WidgetHUD.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -412,7 +412,7 @@ int APlayerCharacter::GetCurrentAmmoCount()
|
|||
{
|
||||
if (CurrentWeapon == nullptr)
|
||||
{
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return CurrentWeapon->GetAmmoCount();
|
||||
|
@ -422,8 +422,38 @@ float APlayerCharacter::GetCurrentHealthCount()
|
|||
{
|
||||
if (!GetHealthComponent())
|
||||
{
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return GetHealthComponent()->GetCurrentHealth();
|
||||
}
|
||||
|
||||
int APlayerCharacter::GetWeaponProjectiles()
|
||||
{
|
||||
if (CurrentWeapon == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return CurrentWeapon->GetWeaponProperties()->ProjectilesPerShot;
|
||||
}
|
||||
|
||||
float APlayerCharacter::GetWeaponCooldown()
|
||||
{
|
||||
if (CurrentWeapon == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return CurrentWeapon->GetWeaponProperties()->WeaponCooldown;
|
||||
}
|
||||
|
||||
float APlayerCharacter::GetWeaponSpread()
|
||||
{
|
||||
if (CurrentWeapon == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return CurrentWeapon->GetWeaponProperties()->WeaponSpread;
|
||||
}
|
||||
|
|
|
@ -129,6 +129,15 @@ public:
|
|||
UFUNCTION(BlueprintCallable)
|
||||
float GetCurrentHealthCount();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
int GetWeaponProjectiles();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
float GetWeaponCooldown();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
float GetWeaponSpread();
|
||||
|
||||
protected:
|
||||
virtual void CalculateHits(TArray<FHitResult>* hits) override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue