Deleted Old LOS Test Class
This commit is contained in:
parent
d34b52f972
commit
2899b9f4a8
BIN
EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset
(Stored with Git LFS)
Binary file not shown.
@ -6,7 +6,6 @@
|
||||
#include "CollisionDebugDrawingPublic.h"
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
#include "Camera/CameraComponent.h"
|
||||
#include "VisionLinkEnemyLOSTest.h"
|
||||
#include "GameFramework/Character.h"
|
||||
|
||||
void AVisionLink::BeginPlay()
|
||||
|
@ -3,7 +3,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "VisionLinkEnemyLOSTest.h"
|
||||
#include "EndlessVendetta/GadgetSystem/ReconGadget.h"
|
||||
#include "VisionLink.generated.h"
|
||||
|
||||
|
@ -1,74 +0,0 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "VisionLinkEnemyLOSTest.h"
|
||||
|
||||
#include "Components/BoxComponent.h"
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
|
||||
// Sets default values
|
||||
AVisionLinkEnemyLOSTest::AVisionLinkEnemyLOSTest()
|
||||
{
|
||||
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void AVisionLinkEnemyLOSTest::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void AVisionLinkEnemyLOSTest::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
}
|
||||
|
||||
void AVisionLinkEnemyLOSTest::TestLOS(TArray<uint32> EnemiesInLink, AActor* LOSActor)
|
||||
{
|
||||
// Get all overlapping Actors
|
||||
UBoxComponent* CollisionBox = Cast<UBoxComponent>(GetComponentByClass(UBoxComponent::StaticClass()));
|
||||
if (!IsValid(CollisionBox))
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
TArray<AActor*> OverlappingEnemies;
|
||||
CollisionBox->GetOverlappingActors(OverlappingEnemies);
|
||||
if (OverlappingEnemies.IsEmpty())
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < OverlappingEnemies.Num(); i++)
|
||||
{
|
||||
// Overlapping Enemies Array should only contain enemies which aren't already in the link
|
||||
if (!OverlappingEnemies[i]->ActorHasTag(FName("Enemy")) || EnemiesInLink.Contains(OverlappingEnemies[i]->GetUniqueID()))
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("enemy name: %s"), *OverlappingEnemies[i]->GetName());
|
||||
OverlappingEnemies.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
if (OverlappingEnemies.IsEmpty())
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
/*for (AActor* Enemy : OverlappingEnemies)
|
||||
{
|
||||
FRotator LookAtRotation = UKismetMathLibrary::FindLookAtRotation(LOSActor->GetActorLocation(), Enemy->GetActorLocation());
|
||||
UE_LOG(LogTemp, Warning, TEXT("Look at Rotation: %f"), LookAtRotation.Yaw);
|
||||
}*/
|
||||
|
||||
Destroy();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,30 +0,0 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "VisionLinkEnemyLOSTest.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class ENDLESSVENDETTA_API AVisionLinkEnemyLOSTest : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
float SpawnOffset = 0;
|
||||
|
||||
// Sets default values for this actor's properties
|
||||
AVisionLinkEnemyLOSTest();
|
||||
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
void TestLOS(TArray<uint32> EnemiesInLink, AActor* LOS_Actor);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user