5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
8#include "ActorPruningSystem.generated.h"
11#define CHUNK_DELAY 0.2f
16 GENERATED_USTRUCT_BODY()
20 UPROPERTY(EditAnywhere, BlueprintReadWrite)
21 TSubclassOf<AActor> ActorClassToPrune =
nullptr;
23 UPROPERTY(EditAnywhere, BlueprintReadWrite)
26 UPROPERTY(EditAnywhere, BlueprintReadWrite)
27 bool bShowAllAtMatchStart = true;
29 UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (EditCondition = "!bShowAllAtMatchStart"))
30 float StartShowingAtMatchTime = 0.0f;
32 UPROPERTY(EditAnywhere, BlueprintReadWrite)
33 AActor* ActorBoundsOverride =
nullptr;
35 bool bSpawned = false;
45 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ActorPruning)
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ActorPruning)
53 static
int ShownActorCount;
55 virtual
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
56 virtual
void BeginPlay() override;
57 virtual
void Tick(
float DeltaSeconds) override;
58 virtual
void MatchStarted() override;
60 void SetActorEnabled(AActor* Actor, const
bool bToggle);
62 void SendChunk(const TArray<AActor*> Chunk);
64 void ValidateActorList(TArray<AActor*>& ActorList);
65 void BuildShowActorList();
66 void SpawnInitialActorsOnServer();
67 void ChunkAndSendShowActorArray(const TArray<AActor*>& ActorsToShow);
68 bool BuildActorBoundsOverrideList(const
FActorPruneInfo& ActorPruneInfo);
71 static
void CallActorPrunerEvents(UObject* Object, const
bool bToggle);
73 UFUNCTION(NetMulticast, Reliable)
74 void Multicast_ShowActors(const TArray<AActor*>& ActorsToShow);
77 TMap<TSubclassOf<AActor>, TArray<AActor*>> ShowActorList;
Definition: ActorPruningSystem.h:40
Definition: ReactsToMatchEvents.h:16
Definition: ActorPruningSystem.h:15