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
 
virtual void OnPushedToLayer ()
 
virtual void OnPoppedFromLayer ()
 
virtual void OnActivated ()
 
virtual void OnDeactivated ()
 
void Activate ()
 
void Deactivate ()
 
FORCEINLINE FGameplayTag GetLayerTag () const
 
FORCEINLINE void SetLayerTag (const FGameplayTag InTag)
 
FORCEINLINE bool IsPrimary () const
 
FORCEINLINE void SetPrimary (const bool InPrimary)
 
FORCEINLINE EWidgetState GetWidgetState () const
 
FORCEINLINE void SetWidgetState (const EWidgetState InState)
 
FORCEINLINE UWaitForWidgetActivationGetActivationHandle ()
 
FORCEINLINE bool HasAppearanceAnim () const
 
FORCEINLINE bool HasDisappearanceAnim () const
 

Protected 멤버 함수

virtual void NativeDestruct () override
 
virtual void OnHealthChanged (const FOnAttributeChangeData &ChangeData)
 
virtual void OnMaxHealthChanged (const FOnAttributeChangeData &ChangeData)
 
virtual void UpdateHpBar ()
 
- UUserWidgetBase(으)로부터 상속된 Protected 멤버 함수
virtual void OnWidgetActivated ()
 
virtual void OnWidgetDeactivated ()
 
void OnPushedToLayer_Internal ()
 
void OnPoppedFromLayer_Internal ()
 
void OnActivated_Internal ()
 
void OnDeactivated_Internal ()
 

Protected 속성

TObjectPtr< UProgressBar > HealthProgressBar
 
float CurrentHealth = 0.0f
 
float CurrentMaxHealth = 1.0f
 
- UUserWidgetBase(으)로부터 상속된 Protected 속성
EWidgetState WidgetState
 
TObjectPtr< UAbilitySystemComponent > ASC
 
FGameplayTag LayerTag
 
bool bPrimary = false
 
TObjectPtr< UWidgetAnimation > AppearanceAnim
 
TObjectPtr< UWidgetAnimation > DisappearanceAnim
 

Private 속성

FDelegateHandle HealthChangedDelegateHandle
 
FDelegateHandle MaxHealthChangedDelegateHandle
 

멤버 함수 문서화

◆ NativeDestruct()

void UHpBarUserWidget::NativeDestruct ( )
overrideprotectedvirtual

UDelayedHpBarWidget, UEnemyHpBarWidget에서 재구현되었습니다.

53{
54 if (ASC)
55 {
56 ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetHealthAttribute()).Remove(HealthChangedDelegateHandle);
57 ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetMaxHealthAttribute()).Remove(MaxHealthChangedDelegateHandle);
58 }
59
60 Super::NativeDestruct();
61}
FDelegateHandle HealthChangedDelegateHandle
Definition HpBarUserWidget.h:39
FDelegateHandle MaxHealthChangedDelegateHandle
Definition HpBarUserWidget.h:40
TObjectPtr< UAbilitySystemComponent > ASC
Definition UserWidgetBase.h:123

◆ OnHealthChanged()

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

◆ OnMaxHealthChanged()

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

◆ SetAbilitySystemComponent()

void UHpBarUserWidget::SetAbilitySystemComponent ( AActor *  InOwner)
overridevirtual

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

UDelayedHpBarWidget, UEnemyHpBarWidget에서 재구현되었습니다.

13{
14 Super::SetAbilitySystemComponent(InOwner);
15
16 if (!ASC)
17 {
18 LOG_ERROR(LogCK, "Failed to get ASC");
19 return;
20 }
21
22 if (HealthChangedDelegateHandle.IsValid())
23 {
24 ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetHealthAttribute()).Remove(HealthChangedDelegateHandle);
25 }
27 {
28 ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetMaxHealthAttribute()).Remove(MaxHealthChangedDelegateHandle);
29 }
30
31 HealthChangedDelegateHandle = ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetHealthAttribute()).AddUObject(this, &ThisClass::OnHealthChanged);
32 MaxHealthChangedDelegateHandle = ASC->GetGameplayAttributeValueChangeDelegate(UBaseAttributeSet::GetMaxHealthAttribute()).AddUObject(this, &ThisClass::OnMaxHealthChanged);
33
34
35 if (const UBaseAttributeSet* CurrentAttributeSet = ASC->GetSet<UBaseAttributeSet>())
36 {
37 CurrentHealth = CurrentAttributeSet->GetHealth();
38 CurrentMaxHealth = CurrentAttributeSet->GetMaxHealth();
40 return;
41 }
42
43 const UWorld* World = GetWorld();
44
45 if (World && World->IsGameWorld() && World->HasBegunPlay())
46 {
47 LOG_ERROR(LogCK, "Failed to get attribute set");
48 }
49}
#define LOG_ERROR(Category, Format,...)
Definition CK_UE.h:40
Definition BaseAttributeSet.h:58
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateHpBar()

void UHpBarUserWidget::UpdateHpBar ( )
protectedvirtual

UDelayedHpBarWidget에서 재구현되었습니다.

76{
78 {
79 LOG_ERROR(LogCK, "Failed to get health progress bar");
80 return;
81 }
82
83 const float Percent = (CurrentMaxHealth > 0.0f) ? (CurrentHealth / CurrentMaxHealth) : 0.0f;
84 HealthProgressBar->SetPercent(Percent);
85}
TObjectPtr< UProgressBar > HealthProgressBar
Definition HpBarUserWidget.h:33
이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ CurrentHealth

float UHpBarUserWidget::CurrentHealth = 0.0f
protected

◆ CurrentMaxHealth

float UHpBarUserWidget::CurrentMaxHealth = 1.0f
protected

◆ HealthChangedDelegateHandle

FDelegateHandle UHpBarUserWidget::HealthChangedDelegateHandle
private

◆ HealthProgressBar

TObjectPtr<UProgressBar> UHpBarUserWidget::HealthProgressBar
protected

◆ MaxHealthChangedDelegateHandle

FDelegateHandle UHpBarUserWidget::MaxHealthChangedDelegateHandle
private

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