KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
USightSystem.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
7#pragma once
8
9#include "CoreMinimal.h"
10#include "Components/ActorComponent.h"
11#include "USightSystem.generated.h"
12
13DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSightDetect, bool, Target);
14
20UCLASS(Blueprintable, BlueprintType, ClassGroup=(Dopple), meta=(BlueprintSpawnableComponent) )
21class LATTELIBRARY_API USightSystem : public UActorComponent
22{
23 GENERATED_BODY()
24
25public:
27 USightSystem();
28
29protected:
31 virtual void BeginPlay() override;
32
33public:
40 virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
41
48 UFUNCTION(BlueprintCallable)
49 void InitSightSystem(class AActor* TargetActor, const float SightLength, const float SightAngle);
50
51private:
57 void SightLineTrace(const float InLength, const float InAngle) const;
63 bool DetectSightLength(const float InLength) const;
69 bool DetectSightAngle(const float InAngle) const;
70
72 void AddElapsedTime();
74 float LerpAlpha() const;
75
76public:
78 UPROPERTY(BlueprintAssignable, Category="Events")
79 FOnSightDetect OnSightDetect;
80
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Debug")
83 bool bDrawDebugLine = false;
84
85private:
87 UPROPERTY()
88 class AActor* OwnerActor;
89
91 UPROPERTY()
92 class AActor* TargetActor;
93
95 bool DetectTarget = false;
97 float SightLength = 1000.0f;
99 float SightAngle = 45.0f;
101 float Duration = 1.0f;
103 float ElapsedTime = 0.0f;
104};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSightDetect, bool, Target)