Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
DelayedHpBarWidget.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "TimerManager.h"
8#include "DelayedHpBarWidget.generated.h"
9
10class UTextBlock;
11class UProgressBar;
12
16UCLASS()
17class CK_UE_API UDelayedHpBarWidget : public UHpBarUserWidget
18{
19 GENERATED_BODY()
20
21public:
22 virtual void SetAbilitySystemComponent(AActor* InOwner) override;
23
24protected:
25 virtual void NativeDestruct() override;
26 virtual void UpdateHpBar() override;
27
28protected:
29 void StartDelayedHpBarDecrease(float InTargetPercent);
30 void SetDelayedHpBarPercent(float InPercent);
31 float GetHealthPercent() const;
32 void RefreshDelayedHpBar();
33 void StopDelayedHpBarDecrease();
34 void UpdateDelayedHpBarDecrease();
35 void UpdateHpText() const;
36
37protected:
38 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI|HpBar")
39 FText HpTextFormat = FText::FromString("{CHP} / {MHP}");
40
41 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI|HpBar")
42 float DelayedDecreaseDuration = 0.5f;
43
44 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UI|HpBar")
45 float DelayedUpdateInterval = 0.016f;
46
47 UPROPERTY(meta = (BindWidget))
48 TObjectPtr<UProgressBar> DelayedHealthProgressBar;
49
50 UPROPERTY(meta = (BindWidgetOptional))
51 TObjectPtr<UTextBlock> HpText;
52
53protected:
54 float DelayedHealthPercent = 1.0f;
55 float DelayedDecreaseStartPercent = 1.0f;
56 float DelayedDecreaseTargetPercent = 1.0f;
57 float DelayedDecreaseElapsedTime = 0.0f;
58
59private:
60 FTimerHandle DelayedDecreaseTimerHandle;
61};
Definition DelayedHpBarWidget.h:18
Definition HpBarUserWidget.h:16