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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,6 +23,5 @@ void UEnemyHealthbarUserWidget::UpdateHealthbar()
|
|||
{
|
||||
float percent = Owner->GetHealthComponent()->GetCurrentHealth() / Owner->GetHealthComponent()->GetMaxHealth();
|
||||
Healthbar->SetPercent(percent);
|
||||
PlayAnimation(RevealHealthbar);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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