19 virtual void BeginPlay()
override;
22 virtual void Tick(
float DeltaTime)
override;
25 void SetActivate(
bool State);
27 UFUNCTION(BlueprintNativeEvent, Category =
"Interaction")
28 void OnActivate(const
bool State);
29 virtual
void OnActivate_Implementation(const
bool State);
33 void OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
34 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
35 bool bFromSweep, const FHitResult& SweepResult);
38 void OnEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
39 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
42 UFUNCTION(BlueprintCallable, Category="SwitchEvent")
43 void OnWeightSwitch(
int InButtonIndex,
bool InActive);
45 bool ActivateTrigger();
53 UFUNCTION(NetMulticast, Reliable)
54 void Multicast_ShowResultPopup(int32 CorrectAnswerIndex);
61 UFUNCTION(NetMulticast, Reliable)
62 void Multicast_ShowWrongPopup(const FString& LuggageColor, const FString& LuggagePattern);
65 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
66 TObjectPtr<class USkeletalMeshComponent> SwitchBody;
68 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
69 TObjectPtr<class UBoxComponent> SwitchCollision;
71 UPROPERTY(BlueprintReadOnly)
74 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
75 TObjectPtr<class UMaterialInstanceDynamic> EmissiveMaterial;
78 TArray<class AActor*> OverlappingActors;
80 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Switch")
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Switch")
83 float Duration = 0.25f;
84 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Switch")
85 float TriggerDelay = 0.25f;
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Visual")
88 FLinearColor ActivateColor = FLinearColor::
Blue;
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Visual")
90 FLinearColor DeactivateColor = FLinearColor::
Yellow;
91 UPROPERTY(EditAnywhere, BlueprintReadWrite)
92 FName EmissiveParam = "EmissiveColor";
94 UPROPERTY(EditAnywhere, BlueprintReadWrite)
95 bool IsPlayerDetect = false;
99 float ElapsedTime = 0.0f;
100 bool DetectTarget = false;
101 bool bActivateState = false;
103 bool AnswerFound = false;