Setup player preview for equipment panel
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "Interactable.h"
|
||||
#include "Engine/OverlapResult.h"
|
||||
#include "CollisionQueryParams.h"
|
||||
#include "DrawDebugHelpers.h"
|
||||
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
||||
|
||||
UInteractionComponent::UInteractionComponent()
|
||||
@@ -204,5 +205,16 @@ bool UInteractionComponent::HasLineOfSightFromPawn(AActor* Target) const
|
||||
|
||||
FHitResult Hit;
|
||||
const bool bBlocked = GetWorld()->LineTraceSingleByChannel(Hit, Start, End, ECC_Visibility, Params);
|
||||
|
||||
#if ENABLE_DRAW_DEBUG
|
||||
if (bDrawDebugLineOfSight)
|
||||
{
|
||||
const FColor LineColor = bBlocked ? FColor::Red : FColor::Green;
|
||||
DrawDebugLine(GetWorld(), Start, bBlocked ? Hit.ImpactPoint : End, LineColor, false, 0.1f, 0, 1.f);
|
||||
if (bBlocked)
|
||||
DrawDebugPoint(GetWorld(), Hit.ImpactPoint, 10.f, FColor::Red, false, 0.1f);
|
||||
}
|
||||
#endif
|
||||
|
||||
return !bBlocked;
|
||||
}
|
||||
Reference in New Issue
Block a user