UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
WorldPartitionLevelStreamingDynamic.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
10#pragma once
11
12#include "CoreMinimal.h"
19#if WITH_EDITOR
21#endif
22#include "WorldPartitionLevelStreamingDynamic.generated.h"
23
24UCLASS(NotPlaceable, NotBlueprintable, HideDropdown, MinimalAPI)
26{
28
29 ENGINE_API void Load();
30 ENGINE_API void Unload();
31 ENGINE_API void Activate();
33 ENGINE_API virtual UWorld* GetStreamingWorld() const override;
34 void SetShouldBeAlwaysLoaded(bool bInShouldBeAlwaysLoaded) { bShouldBeAlwaysLoaded = bInShouldBeAlwaysLoaded; }
35 const UWorldPartitionRuntimeCell* GetWorldPartitionRuntimeCell() const { return StreamingCell.Get(); }
36
37 virtual bool ShouldBeAlwaysLoaded() const override { return bShouldBeAlwaysLoaded; }
38 ENGINE_API virtual bool ShouldBlockOnUnload() const override;
39 virtual bool ShouldRequireFullVisibilityToRender() const override { return true; }
40 ENGINE_API virtual bool RequestVisibilityChange(bool bVisible) override;
41 virtual const IWorldPartitionCell* GetWorldPartitionCell() const override { return GetWorldPartitionRuntimeCell(); }
42
43#if !WITH_EDITOR
44 ENGINE_API virtual void PostLoad();
45#endif
46
48 ENGINE_API void SetLevelTransform(const FTransform& InLevelTransform);
49 const FSoftObjectPath& GetOuterWorldPartition() const { return OuterWorldPartition.ToSoftObjectPath(); }
50
51 virtual bool CanReplicateStreamingStatus() const override { return false; }
52
53#if WITH_EDITOR
54 // Override ULevelStreaming
55 ENGINE_API virtual bool RequestLevel(UWorld* PersistentWorld, bool bAllowLevelLoadRequests, EReqLevelBlock BlockPolicy) override;
56 ENGINE_API virtual void BeginDestroy() override;
58
59 bool GetLoadSucceeded() const { return bLoadSucceeded; }
60
62
63 UE_DEPRECATED(5.7, "LoadInEditor() is no longer supported and will be removed in a future version.")
65
66 UE_DEPRECATED(5.7, "UnloadFromEditor() is no longer supported and will be removed in a future version.")
68
69private:
73 ENGINE_API void OnCleanupLevel();
74 virtual void OnCurrentStateChanged(ELevelStreamingState InPrevState, ELevelStreamingState InNewState) override;
75
77
81
82#if WITH_EDITORONLY_DATA
83 UPROPERTY()
85#endif
86
87 FDelegateHandle OnCleanupLevelDelegateHandle;
89 bool bLoadSucceeded;
90 FWorldPartitionLevelHelper::FPackageReferencer PackageReferencer;
91#endif
92
93private:
94 ENGINE_API void UpdateShouldSkipMakingVisibilityTransactionRequest();
95 ENGINE_API bool CanChangeVisibility(bool bMakeVisible) const;
96
97 UPROPERTY()
98 bool bShouldBeAlwaysLoaded;
99
100 bool bHasSetLevelTransform;
101
102#if WITH_EDITORONLY_DATA
103 UPROPERTY()
105
106 UPROPERTY()
108#endif
109
110 UPROPERTY()
112
113 UPROPERTY()
114 TSoftObjectPtr<UWorldPartition> OuterWorldPartition;
115};
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ELevelStreamingState
Definition LevelStreaming.h:111
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition IDelegateInstance.h:14
Definition NameTypes.h:617
Definition WorldPartitionRuntimeCellInterface.h:19
Definition Array.h:670
Definition LevelStreamingDynamic.h:21
EReqLevelBlock
Definition LevelStreaming.h:684
Definition WorldPartitionLevelStreamingDynamic.h:26
Definition WorldPartitionRuntimeCell.h:236
Definition WorldPartitionRuntimeLevelStreamingCell.h:17
Definition World.h:918
Definition SoftObjectPath.h:56
Definition ObjectPtr.h:488
Definition Optional.h:131
Definition SoftObjectPtr.h:174
Definition WeakObjectPtrTemplates.h:25