Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
TargetSelector.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "UObject/Object.h"
7#include "TargetSelector.generated.h"
8
10class AActor;
11class APlayerController;
13
14
15UENUM(BlueprintType)
22
23
24USTRUCT(BlueprintType)
26{
27 GENERATED_BODY()
28
29public:
30 UPROPERTY(BlueprintReadOnly, Category = "Target")
31 bool bHasTarget = false;
32
33 UPROPERTY(BlueprintReadOnly, Category = "Target")
34 TObjectPtr<AActor> TargetActor = nullptr;
35
36 UPROPERTY(BlueprintReadOnly, Category = "Target")
37 FVector TargetLocation = FVector::ZeroVector;
38
39 UPROPERTY(BlueprintReadOnly, Category = "Target")
40 float TargetDistance = 0.0f;
41};
42
43
44UCLASS(Blueprintable, EditInlineNew, DefaultToInstanced)
45class CK_UE_API UTargetSelector : public UObject
46{
47 GENERATED_BODY()
48
49public:
50 bool ResolveTarget(const AMainPlayerCharacter* Player, FTargetSelectionResult& OutResult) const;
51
52private:
53 ITargetableInterface* GetCurrentTarget(const AMainPlayerCharacter* Player) const;
54 TArray<ITargetableInterface*> GatherTargets(const AMainPlayerCharacter* Player) const;
55 TArray<ITargetableInterface*> FilterVisibleTargets(const APlayerController* PC, const TArray<ITargetableInterface*>& Candidates) const;
56 ITargetableInterface* PickDensityCenterTarget(const AMainPlayerCharacter* Player, const TArray<ITargetableInterface*>& Candidates) const;
57 TArray<ITargetableInterface*> FilterTargetsInPlayerRange(const AMainPlayerCharacter* Player, const TArray<ITargetableInterface*>& Candidates) const;
58
59private:
60 bool HasLineOfSight(const APlayerController* PC, ITargetableInterface* Targetable) const;
61 bool IsTargetInCameraView(const APlayerController* PC, ITargetableInterface* Targetable) const;
62
63protected:
64 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Target")
66
67 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Target", meta = (ClampMin = "0.0"))
68 float TargetSearchRange = 2000.0f;
69
70 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Target", meta = (ClampMin = "0.0"))
71 float FallbackSearchRange = 2000.0f;
72
73 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Target", meta = (ClampMin = "0.0"))
74 float DensityRadius = 350.0f;
75
76 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Target")
77 bool bUseLineOfSight = true;
78};
ETargetSelectionMode
Definition TargetSelector.h:17
Definition MainPlayerCharacter.h:39
Definition TargetableInterface.h:20
Definition TargetSelector.h:46
Definition TargetSelector.h:26