Created Show and Hide Widget Functions
This commit is contained in:
parent
d408958096
commit
220f9ef159
@ -200,10 +200,12 @@ void ABaseWeaponClass::Fire()
|
||||
if (!Cast<AAICharacter>(outHit.GetActor())) return;
|
||||
Cast<AAICharacter>(outHit.GetActor())->TakeDamage(tempWeaponDamage, FPointDamageEvent(), GetWorld()->GetFirstPlayerController(), this);
|
||||
}
|
||||
HideNeedReloadUI();
|
||||
}
|
||||
else if(currentAmmoCount <= 0)
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("No ammo, Ammo count: %d"), currentAmmoCount);
|
||||
ShowNeedReloadUI();
|
||||
}
|
||||
|
||||
}
|
||||
@ -241,6 +243,7 @@ void ABaseWeaponClass::WeaponReload()
|
||||
currentAmmoCount = MagazineSize;
|
||||
endlessVendettaChar->bIsReloading = false;
|
||||
HideReloadingWidget();
|
||||
HideNeedReloadUI();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -179,6 +179,12 @@ public:
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetupSilencerAttachment(UStaticMesh* SilencerMesh);
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void ShowNeedReloadUI();
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void HideNeedReloadUI();
|
||||
|
||||
protected:
|
||||
UArrowComponent* GunStartArrow;
|
||||
bool bStopShooting = false;
|
||||
|
Loading…
Reference in New Issue
Block a user