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();
|
auto healthComponent = Owner->GetHealthComponent();
|
||||||
healthComponent->OnDamaged.BindUFunction(this, "UpdateHealthbar");
|
healthComponent->OnDamaged.BindUFunction(this, "UpdateHealthbar");
|
||||||
float percent = Owner->GetHealthComponent()->GetCurrentHealth() / Owner->GetHealthComponent()->GetMaxHealth();
|
UpdateHealthbar();
|
||||||
Healthbar->SetPercent(percent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +23,5 @@ void UEnemyHealthbarUserWidget::UpdateHealthbar()
|
||||||
{
|
{
|
||||||
float percent = Owner->GetHealthComponent()->GetCurrentHealth() / Owner->GetHealthComponent()->GetMaxHealth();
|
float percent = Owner->GetHealthComponent()->GetCurrentHealth() / Owner->GetHealthComponent()->GetMaxHealth();
|
||||||
Healthbar->SetPercent(percent);
|
Healthbar->SetPercent(percent);
|
||||||
PlayAnimation(RevealHealthbar);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,6 @@ public:
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||||
UProgressBar* Healthbar;
|
UProgressBar* Healthbar;
|
||||||
|
|
||||||
UPROPERTY(Transient, meta = (BindWidgetAnim))
|
|
||||||
UWidgetAnimation* RevealHealthbar;
|
|
||||||
|
|
||||||
AEnemyCharacter* Owner;
|
AEnemyCharacter* Owner;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue