9#include "CoreMinimal.h"
10#include "Components/ActorComponent.h"
11#include "USightSystem.generated.h"
20UCLASS(Blueprintable, BlueprintType, ClassGroup=(Dopple), meta=(BlueprintSpawnableComponent) )
21class LATTELIBRARY_API USightSystem :
public UActorComponent
31 virtual
void BeginPlay() override;
40 virtual
void TickComponent(
float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
48 UFUNCTION(BlueprintCallable)
49 void InitSightSystem(class AActor* TargetActor, const
float SightLength, const
float SightAngle);
57 void SightLineTrace(const
float InLength, const
float InAngle) const;
63 bool DetectSightLength(const
float InLength) const;
69 bool DetectSightAngle(const
float InAngle) const;
72 void AddElapsedTime();
74 float LerpAlpha() const;
78 UPROPERTY(BlueprintAssignable, Category="Events")
79 FOnSightDetect OnSightDetect;
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Debug")
83 bool bDrawDebugLine = false;
88 class AActor* OwnerActor;
92 class AActor* TargetActor;
95 bool DetectTarget = false;
97 float SightLength = 1000.0f;
99 float SightAngle = 45.0f;
101 float Duration = 1.0f;
103 float ElapsedTime = 0.0f;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSightDetect, bool, Target)