Space Plunder
Loading...
Searching...
No Matches
HealthBarWidgetComponent.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "HealthBarWidgetComponent.generated.h"
8
9UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent) )
10class HEALTH_API UHealthBarWidgetComponent : public UScreenFacingWidgetComponent
11{
12 GENERATED_BODY()
13
14public:
15 UHealthBarWidgetComponent();
16
17 virtual void BeginPlay() override;
18
19
20 UFUNCTION(BlueprintCallable)
21 void SetHasShield(const bool in_bHasShield);
22 UFUNCTION(BlueprintCallable)
23 void UpdateHealth(const float CurrentHealth, const float MaxHealth, const class UDamageType* DamageType);
24 UFUNCTION(BlueprintCallable)
25 void UpdateHeathAndShield(const float CurrentHealth, const float MaxHealth, const float CurrentShield, const float MaxShield, const class UDamageType* DamageType);
26
27 void SetCollapsedAfterDamage();
28 void SetCollapsedAfterFocus();
29
30 UFUNCTION(BlueprintCallable)
31 void ShowHealthBar();
32
33
34protected:
35 virtual void OnComponentDestroyed(bool bDestroyingHierarchy) override;
36
37 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Health")
38 float FocusTimeCollapsedDelay = 3.0f;
39 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Health")
40 float DamageCollapsedDelay = 10.0f;
41
42private:
43
44 void HideHealthBar();
45
46 UPROPERTY()
47 class UHealthWidget* HealthWidget = nullptr;
48
49 FTimerHandle FocusTimerHandle;
50 FTimerHandle DamagedTimerHandle;
51
52};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition Health.Build.cs:6
Definition HealthWidget.h:13