KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
UInteractionSystem.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
8#pragma once
9
10#include "CoreMinimal.h"
11#include "Components/ActorComponent.h"
12#include "UInteractionSystem.generated.h"
13
19UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
20class ONEPIECE_API UInteractionSystem : public UActorComponent
21{
22 GENERATED_BODY()
23
24public:
25 UInteractionSystem();
26
27protected:
28 virtual void BeginPlay() override;
29 virtual void TickComponent(float DeltaTime, ELevelTick TickType,
30 FActorComponentTickFunction* ThisTickFunction) override;
31
32public:
33 // ========================================
34 // 설정
35 // ========================================
36
38 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interaction")
39 float InteractionDistance = 1200.0f;
40
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Debug")
43 bool bShowDebugInfo = true;
44
45 // ========================================
46 // 상태
47 // ========================================
48
50 UPROPERTY(BlueprintReadOnly, Category = "Interaction")
51 TObjectPtr<class UInteractableComponent> CurrentTarget;
52
54 UPROPERTY(BlueprintReadOnly, Category = "Interaction")
55 TObjectPtr<class UInteractableComponent> HoldingInteractable;
56
57 // ========================================
58 // 공개 인터페이스
59 // ========================================
60
62 UFUNCTION(BlueprintCallable, Category = "Interaction")
63 void TryInteract();
64
66 UFUNCTION(BlueprintCallable, Category = "Interaction")
67 void TryPickUp();
68
70 UFUNCTION(BlueprintCallable, Category = "Interaction")
71 void TryDrop();
72
74 void RegisterInteractable(class UInteractableComponent* Interactable);
75
77 void UnregisterInteractable(class UInteractableComponent* Interactable);
78
80 UFUNCTION(BlueprintCallable, Category = "Interaction")
81 USceneComponent* GetHoldPosition() const;
82
84 UFUNCTION(BlueprintCallable, Category = "Interaction")
85 bool PerformCenterLineTrace(FHitResult& OutHit);
86
87protected:
88 // ========================================
89 // 감지 시스템
90 // ========================================
91
93 UInteractableComponent* DetectInteractableTarget();
94
95private:
96 // ========================================
97 // 내부 데이터
98 // ========================================
99
101 UPROPERTY()
102 TArray<TObjectPtr<class UInteractableComponent>> NearbyInteractables;
103
105 UPROPERTY()
106 TObjectPtr<class APlayerActor> OwnerPlayer;
107};
Main character driven directly by the player.