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