A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
HighlightComponent.h
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
7#include "HighlightComponent.generated.h"
8
9UENUM()
10enum class EHighlightColor : uint8
11{
12 None = 0,
13 White = 250,
14 Blue = 251,
15 Green = 252,
16 Yellow = 253,
17 Red = 254,
18 Pink = 255
19};
20
21DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnHighlightValueChanged);
22
26UCLASS(Blueprintable, ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
27class PIXOCORE_API UHighlightComponent : public UActorComponent
28{
29 GENERATED_BODY()
30
31public:
33
34protected:
35 virtual void BeginPlay() override;
36
37public:
42 UFUNCTION(BlueprintCallable)
43 void UpdateHighlightValue(EHighlightColor HighlightColor);
48 UFUNCTION(BlueprintCallable)
49 void ActivatePulseHighlight(bool Activate);
50
51 UPROPERTY()
52 EHighlightColor CurrentHighlight = EHighlightColor::None;
53 UPROPERTY()
54 bool IsShowHighlight = true;
55 UPROPERTY(BlueprintReadWrite)
56 FTimerHandle PulseHighlightTimerHandle;
57
58 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Highlight")
59 bool AlwaysEmissiveHighlight = false;
60
61 UPROPERTY(BlueprintAssignable)
62 FOnHighlightValueChanged OnHighlightValueChanged;
63
64 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Highlight")
65 bool UseIsObjectActiveInsteadOfActiveSteps = false;
66
67 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Highlight")
68 TArray<FText> HighlightActiveOnSteps;
70 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Highlight")
71 bool ActivateHighlightOnEachStep = false;
72
73private:
74 UFUNCTION()
75 void PerformPulseHighlight();
76 void ChangeHighlightMaterialColor(const TFunctionRef<FVector()> Color);
77
78 TMap<EHighlightColor, FLinearColor> ColorMap;
79 float HighlightTime = 0.0f;
80 float PulseDirection = 0.0f;
81 bool BlockPulsing = false;
82};
EHighlightColor
UENUM()
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnHighlightValueChanged)
Component responsible for managing object highlighting.
TMap< EHighlightColor, FLinearColor > ColorMap
TArray< FText > HighlightActiveOnSteps
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Highlight")
FTimerHandle PulseHighlightTimerHandle
UPROPERTY(BlueprintReadWrite)
FOnHighlightValueChanged OnHighlightValueChanged
UPROPERTY(BlueprintAssignable)