38 virtual
void Tick(
float DeltaTime) override;
44 void SetButtonVisibility(
bool bVisible);
50 FButtonPressedDelegate& OnButtonPressed() {
return ButtonPressedDelegate; }
55 FButtonReleasedDelegate& OnButtonReleased() {
return ButtonReleasedDelegate; }
61 UFUNCTION(BlueprintCallable, BlueprintPure)
62 EButtonState GetButtonState()
const {
return CurrentButtonState; }
68 UFUNCTION(BlueprintCallable)
74 UFUNCTION(BlueprintCallable)
75 void SetButtonName(
const FName& InButtonName);
77 virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps)
const override;
79 UPROPERTY(BlueprintAssignable)
80 FButtonPressedDelegate ButtonPressedDelegate;
81 UPROPERTY(BlueprintAssignable)
82 FButtonReleasedDelegate ButtonReleasedDelegate;
85 virtual void BeginPlay()
override;
90 UFUNCTION(BlueprintNativeEvent)
95 UFUNCTION(BlueprintNativeEvent)
100 void OnBeginOverlapButton(UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
101 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
bool bFromSweep,
102 const FHitResult& SweepResult);
108 void MovingButtonTimelineProgress(
float Value);
113 void MovingButtonTimelineFinished();
116 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
118 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
120 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
122 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
123 UPointLightComponent* PointLightComp;
124 UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Components)
125 UTextRenderComponent* TextRenderComp;
127 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
128 bool bIsButtonHaveText = false;
129 UPROPERTY(Replicated, EditAnywhere, BlueprintReadOnly, Category = Setup, meta = (EditCondition = "bIsButtonHaveText = true", EditConditionHides))
130 FName ButtonText = "Button Text";
131 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
132 USoundBase* ButtonPressSound;
133 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
134 UCurveFloat* MovingButtonCurve;
135 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
136 UForceFeedbackEffect* LeftHandFeedbackEffect;
137 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Setup)
138 UForceFeedbackEffect* RightHandFeedbackEffect;
141 bool bIsPressed = false;
144 FTimeline MovingButtonTimeLine;
146 TEnumAsByte<ETimelineDirection::Type> TimelineDirection;