KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
AWeightSwitch.h
이 파일의 문서화 페이지로 가기
1// Copyright (c) 2025 Doppleddiggong. All rights reserved. Unauthorized copying, modification, or distribution of this file, via any medium is strictly prohibited. Proprietary and confidential.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
7#include "AWeightSwitch.generated.h"
8
9
10UCLASS()
11class ONEPIECE_API AWeightSwitch : public AActor
12{
13 GENERATED_BODY()
14
15public:
17
18protected:
19 virtual void BeginPlay() override;
20
21public:
22 virtual void Tick(float DeltaTime) override;
23
24 void InitSwitch();
25 void SetActivate(bool State);
26
27 UFUNCTION(BlueprintNativeEvent, Category = "Interaction")
28 void OnActivate(const bool State);
29 virtual void OnActivate_Implementation(const bool State);
30
31private:
32 UFUNCTION()
33 void OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
34 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex,
35 bool bFromSweep, const FHitResult& SweepResult);
36
37 UFUNCTION()
38 void OnEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
39 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
40
41
42 UFUNCTION(BlueprintCallable, Category="SwitchEvent")
43 void OnWeightSwitch(int InButtonIndex, bool InActive);
44
45 bool ActivateTrigger();
46
53 UFUNCTION(NetMulticast, Reliable)
54 void Multicast_ShowResultPopup(int32 CorrectAnswerIndex);
55
61 UFUNCTION(NetMulticast, Reliable)
62 void Multicast_ShowWrongPopup(const FString& LuggageColor, const FString& LuggagePattern);
63
64public:
65 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
66 TObjectPtr<class USkeletalMeshComponent> SwitchBody;
67
68 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
69 TObjectPtr<class UBoxComponent> SwitchCollision;
70
71 UPROPERTY(BlueprintReadOnly)
72 TObjectPtr<class UTweenAnimInstance> AnimBlueprint;
73
74 UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
75 TObjectPtr<class UMaterialInstanceDynamic> EmissiveMaterial;
76
77 UPROPERTY()
78 TArray<class AActor*> OverlappingActors;
79
80 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Switch")
81 int ButtonIndex = 0;
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Switch")
83 float Duration = 0.25f;
84 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Switch")
85 float TriggerDelay = 0.25f;
86
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";
93
94 UPROPERTY(EditAnywhere, BlueprintReadWrite)
95 bool IsPlayerDetect = false;
96
97
98private:
99 float ElapsedTime = 0.0f;
100 bool DetectTarget = false;
101 bool bActivateState = false;
102
103 bool AnswerFound = false;
104};
블루프린트에서 사용할 수 있는 간단한 트윈 애님 인스턴스.