Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
UHpBarUserWidget 클래스 참조

#include <HpBarUserWidget.h>

UHpBarUserWidget에 대한 상속 다이어그램 :
Inheritance graph
UHpBarUserWidget에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

virtual void SetAbilitySystemComponent (AActor *InOwner) override
 
- UUserWidgetBase(으)로부터 상속된 Public 멤버 함수
virtual UAbilitySystemComponent * GetAbilitySystemComponent () const override
 

Protected 멤버 함수

virtual void NativeDestruct () override
 
virtual void OnHealthChanged (const FOnAttributeChangeData &ChangeData)
 
virtual void OnMaxHealthChanged (const FOnAttributeChangeData &ChangeData)
 
void UpdateHpBar ()
 

Protected 속성

TObjectPtr< class UProgressBar > HpBar
 
float CurrentHealth = 0.0f
 
float CurrentMaxHealth = 1.0f
 
- UUserWidgetBase(으)로부터 상속된 Protected 속성
TObjectPtr< UAbilitySystemComponent > ASC
 

Private 속성

FDelegateHandle HealthChangedDelegateHandle
 
FDelegateHandle MaxHealthChangedDelegateHandle
 

멤버 함수 문서화

◆ NativeDestruct()

void UHpBarUserWidget::NativeDestruct ( )
overrideprotectedvirtual
38{
39 if (ASC)
40 {
41 ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetHealthAttribute()).Remove(HealthChangedDelegateHandle);
42 ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetMaxHealthAttribute()).Remove(MaxHealthChangedDelegateHandle);
43 }
44
45 Super::NativeDestruct();
46}
FDelegateHandle HealthChangedDelegateHandle
Definition HpBarUserWidget.h:37
FDelegateHandle MaxHealthChangedDelegateHandle
Definition HpBarUserWidget.h:38
TObjectPtr< UAbilitySystemComponent > ASC
Definition UserWidgetBase.h:24

◆ OnHealthChanged()

void UHpBarUserWidget::OnHealthChanged ( const FOnAttributeChangeData &  ChangeData)
protectedvirtual
49{
50 CurrentHealth = ChangeData.NewValue;
52}
float CurrentHealth
Definition HpBarUserWidget.h:33
void UpdateHpBar()
Definition HpBarUserWidget.cpp:60
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ OnMaxHealthChanged()

void UHpBarUserWidget::OnMaxHealthChanged ( const FOnAttributeChangeData &  ChangeData)
protectedvirtual
55{
56 CurrentMaxHealth = ChangeData.NewValue;
58}
float CurrentMaxHealth
Definition HpBarUserWidget.h:34
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ SetAbilitySystemComponent()

void UHpBarUserWidget::SetAbilitySystemComponent ( AActor *  InOwner)
overridevirtual

UUserWidgetBase(으)로부터 재구현되었습니다.

11{
12 Super::SetAbilitySystemComponent(InOwner);
13
14 if (ASC)
15 {
16 if (HealthChangedDelegateHandle.IsValid())
17 {
18 ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetHealthAttribute()).Remove(HealthChangedDelegateHandle);
19 }
21 {
22 ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetMaxHealthAttribute()).Remove(MaxHealthChangedDelegateHandle);
23 }
24
25 HealthChangedDelegateHandle = ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetHealthAttribute()).AddUObject(this, &ThisClass::OnHealthChanged);
26 MaxHealthChangedDelegateHandle = ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetMaxHealthAttribute()).AddUObject(this, &ThisClass::OnMaxHealthChanged);
27
28 if (const UBaseAttributeSet* CurrentAttributeSet = ASC->GetSet<UBaseAttributeSet>())
29 {
30 CurrentHealth = CurrentAttributeSet->GetHealth();
31 CurrentMaxHealth = CurrentAttributeSet->GetMaxHealth();
33 }
34 }
35}
Definition BaseAttributeSet.h:21
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateHpBar()

void UHpBarUserWidget::UpdateHpBar ( )
protected
61{
62 if (HpBar)
63 {
64 const float Percent = (CurrentMaxHealth > 0.0f) ? (CurrentHealth / CurrentMaxHealth) : 0.0f;
65 HpBar->SetPercent(Percent);
66 }
67}
TObjectPtr< class UProgressBar > HpBar
Definition HpBarUserWidget.h:31
이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ CurrentHealth

float UHpBarUserWidget::CurrentHealth = 0.0f
protected

◆ CurrentMaxHealth

float UHpBarUserWidget::CurrentMaxHealth = 1.0f
protected

◆ HealthChangedDelegateHandle

FDelegateHandle UHpBarUserWidget::HealthChangedDelegateHandle
private

◆ HpBar

TObjectPtr<class UProgressBar> UHpBarUserWidget::HpBar
protected

◆ MaxHealthChangedDelegateHandle

FDelegateHandle UHpBarUserWidget::MaxHealthChangedDelegateHandle
private

이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: