2023-01-31 14:46:14 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Subsystems/WorldSubsystem.h"
|
|
|
|
|
#include "GeometryCollectionISMPoolSubSystem.generated.h"
|
|
|
|
|
|
|
|
|
|
class AGeometryCollectionISMPoolActor;
|
2023-08-25 13:36:52 -04:00
|
|
|
class ULevel;
|
2023-01-31 14:46:14 -05:00
|
|
|
/**
|
2023-06-08 19:39:06 -04:00
|
|
|
* A subsystem managing ISMPool actors.
|
|
|
|
|
* Used by geometry collection now but repurposed for more general use.
|
|
|
|
|
*/
|
2023-06-17 18:13:06 -04:00
|
|
|
UCLASS(MinimalAPI)
|
|
|
|
|
class UGeometryCollectionISMPoolSubSystem : public UWorldSubsystem
|
2023-01-31 14:46:14 -05:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
2023-06-17 18:13:06 -04:00
|
|
|
GEOMETRYCOLLECTIONENGINE_API UGeometryCollectionISMPoolSubSystem();
|
2023-01-31 14:46:14 -05:00
|
|
|
|
|
|
|
|
// USubsystem BEGIN
|
2023-06-17 18:13:06 -04:00
|
|
|
GEOMETRYCOLLECTIONENGINE_API virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
|
|
|
|
GEOMETRYCOLLECTIONENGINE_API virtual void Deinitialize() override;
|
2023-01-31 14:46:14 -05:00
|
|
|
// USubsystem END
|
|
|
|
|
|
2023-06-08 19:39:06 -04:00
|
|
|
/** Finds or creates an actor. */
|
2023-08-25 13:36:52 -04:00
|
|
|
GEOMETRYCOLLECTIONENGINE_API AGeometryCollectionISMPoolActor* FindISMPoolActor(ULevel* Level);
|
2023-06-08 19:39:06 -04:00
|
|
|
|
|
|
|
|
/** Get all actors managed by the subsystem. */
|
2023-06-17 18:13:06 -04:00
|
|
|
GEOMETRYCOLLECTIONENGINE_API void GetISMPoolActors(TArray<AGeometryCollectionISMPoolActor*>& OutActors) const;
|
2023-01-31 14:46:14 -05:00
|
|
|
|
|
|
|
|
protected:
|
2023-08-25 13:36:52 -04:00
|
|
|
UFUNCTION()
|
|
|
|
|
void OnActorEndPlay(AActor* InSource, EEndPlayReason::Type Reason);
|
|
|
|
|
|
|
|
|
|
/** ISMPool are per level **/
|
|
|
|
|
TMap<TObjectPtr<ULevel>, TObjectPtr<AGeometryCollectionISMPoolActor> > PerLevelISMPoolActors;
|
2023-01-31 14:46:14 -05:00
|
|
|
};
|