You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
505 B
20 lines
505 B
2 years ago
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||
|
|
||
|
|
||
|
#include "HealthBar.h"
|
||
|
|
||
|
#include "Components/ProgressBar.h"
|
||
|
|
||
|
void UHealthBar::SetOwnerTrooper(ATrooper *Trooper) {
|
||
|
OwnerTrooper = Trooper;
|
||
|
}
|
||
|
|
||
|
void UHealthBar::NativeTick(const FGeometry &MyGeometry, float InDeltaTime) {
|
||
|
Super::NativeTick(MyGeometry, InDeltaTime);
|
||
|
if (!OwnerTrooper.IsValid())
|
||
|
return;
|
||
|
|
||
2 years ago
|
HealthBar->SetPercent(
|
||
|
OwnerTrooper->GetHitPoints() / OwnerTrooper->GetMaxHitPoints());
|
||
2 years ago
|
}
|