Compare commits
No commits in common. "29246357dc43a0a7eda70b61035c3ff2b2b7d233" and "5e0433905f236b1f425760bbee94486ea0f4cec8" have entirely different histories.
29246357dc
...
5e0433905f
BIN
Content/UI/EnemyHealthbar/EnemyHealthbar.uasset (Stored with Git LFS)
BIN
Content/UI/EnemyHealthbar/EnemyHealthbar.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/UI/EnemyHealthbar/M_WhitePixel.uasset (Stored with Git LFS)
BIN
Content/UI/EnemyHealthbar/M_WhitePixel.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -13,8 +13,7 @@ void UEnemyHealthbarUserWidget::BindOwner(AEnemyCharacter* NewOwner)
|
|||
{
|
||||
auto healthComponent = Owner->GetHealthComponent();
|
||||
healthComponent->OnDamaged.BindUFunction(this, "UpdateHealthbar");
|
||||
float percent = Owner->GetHealthComponent()->GetCurrentHealth() / Owner->GetHealthComponent()->GetMaxHealth();
|
||||
Healthbar->SetPercent(percent);
|
||||
UpdateHealthbar();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +22,6 @@ void UEnemyHealthbarUserWidget::UpdateHealthbar()
|
|||
if (Owner)
|
||||
{
|
||||
float percent = Owner->GetHealthComponent()->GetCurrentHealth() / Owner->GetHealthComponent()->GetMaxHealth();
|
||||
Healthbar->SetPercent(percent);
|
||||
PlayAnimation(RevealHealthbar);
|
||||
Healthbar->SetPercent(percent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,9 +21,6 @@ public:
|
|||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||
UProgressBar* Healthbar;
|
||||
|
||||
UPROPERTY(Transient, meta = (BindWidgetAnim))
|
||||
UWidgetAnimation* RevealHealthbar;
|
||||
|
||||
AEnemyCharacter* Owner;
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue