Compare commits

..

No commits in common. "29246357dc43a0a7eda70b61035c3ff2b2b7d233" and "5e0433905f236b1f425760bbee94486ea0f4cec8" have entirely different histories.

4 changed files with 6 additions and 11 deletions

Binary file not shown.

Binary file not shown.

View File

@ -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);
}
}

View File

@ -21,9 +21,6 @@ public:
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
UProgressBar* Healthbar;
UPROPERTY(Transient, meta = (BindWidgetAnim))
UWidgetAnimation* RevealHealthbar;
AEnemyCharacter* Owner;
public: