9#include "Engine/World.h"
10#include "Engine/GameViewportClient.h"
11#include "Engine/GameInstance.h"
17 Super::Initialize(Collection);
20 UE_LOG(LogTemp, Warning, TEXT(
"SensorManager Initilized."));
26 Super::Deinitialize();
32 UE_LOG(LogTemp, Warning, TEXT(
"SensorManager Destroyed."));
43 if (GEngine && GEngine->GameViewport)
45 if (UWorld* World = GEngine->GameViewport->GetWorld())
47 if (UGameInstance* GameInstance = World->GetGameInstance())
61 if (Manager && SensorPtr)
63 Manager->
Sensors.Add(SensorPtr);
71 if (Manager && SensorPtr)
73 Manager->
Sensors.Remove(SensorPtr);
85 TArray<ASensor*> SensorsOfType;
89 if (Sensor && Sensor->GetSensorType() == SensorType)
91 SensorsOfType.Add(Sensor);
static USensorManager * Get()
FSensorDestroyedDelegate OnSensorDestroyed
static void AddSensor(ASensor *SensorPtr)
TArray< ASensor * > Sensors
TArray< ASensor * > GetAllSensorsOfType(ESensorTypes SensorType) const
static USensorManager * SensorManagerPtr
TArray< ASensor * > GetAllSensors() const
FSensorSpawnedDelegate OnSensorSpawned
static void RemoveSensor(ASensor *SensorPtr)
virtual void Initialize(FSubsystemCollectionBase &Collection) override
virtual void Deinitialize() override