UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LevelInstanceEditorPropertyOverrideLevelStreaming.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreFwd.h"
7#include "Engine/Level.h"
13#include "LevelInstanceEditorPropertyOverrideLevelStreaming.generated.h"
14
17
18UCLASS(Transient, MinimalAPI)
20{
22
23#if WITH_EDITOR
24public:
25 ILevelInstanceInterface* GetLevelInstance() const;
26
27 // Begin ULevelStreaming Interface
28 virtual bool ShowInLevelCollection() const override { return false; }
29 virtual bool IsUserManaged() const override { return false; }
31 // End ULevelStreaming Interface
32
33private:
36
37 UObject* GetArchetypeForObject(const UObject* InObject) const;
39
40 const FLevelInstanceID& GetLevelInstanceID() const { return LevelInstanceID; }
41
42 friend class ULevelInstanceSubsystem;
43
46
47 // Begin ULevelStreaming Interface
48 virtual void OnLevelLoadedChanged(ULevel* Level) override;
49 // End ULevelStreaming Interface
50
52 {
56 };
57
59 {
60 Actor,
61 Archetype,
63 };
64
69 void OnPreInitializeContainerInstance(UActorDescContainerInstance::FInitializeParams& InInitParams, UActorDescContainerInstance* InContainerInstance);
70 virtual void OnCurrentStateChanged(ELevelStreamingState InPrevState, ELevelStreamingState InNewState) override;
71 void OnObjectPropertyChanged(UObject* Object, struct FPropertyChangedEvent& Event);
72
73 static UWorld* LoadArchetypeWorld(const FString& InWorldPackageName, const FString& InSuffix);
75
76 static void ApplyTransform(AActor* InActor, const FTransform& InTransform, bool bDoPostEditMove);
77
78 FLevelInstanceID LevelInstanceID;
79
81 {
82 public:
83 virtual ~FPropertyOverridePolicy() {}
84
86 {
87 Level = InLevel;
89 Policy = InPolicy;
90 }
91
92 virtual UObject* GetArchetypeForObject(const UObject* InObject) const override
93 {
94 return InObject == Level ? LevelArchetype : nullptr;
95 }
96
97 virtual bool CanEditProperty(const FEditPropertyChain& PropertyChain, const UObject* Object) const override
98 {
99 return CanEditProperty(PropertyChain.GetActiveNode()->GetValue(), Object);
100 }
101
102 virtual bool CanEditProperty(const FProperty* Property, const UObject* Object) const override
103 {
104 if (Object->GetTypedOuter<ULevel>() == Level)
105 {
106 return Policy && Policy->CanOverrideProperty(Property);
107 }
108
109 // Don't interfere with other levels
110 return true;
111 }
112
113 private:
114 TObjectPtr<ULevel> Level = nullptr;
117 };
118
119 FPropertyOverridePolicy PropertyOverridePolicy;
120
122#endif
123
124#if WITH_EDITORONLY_DATA
127#endif
128};
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 Actor.h:257
Definition UnrealType.h:6738
UE_API TDoubleLinkedListNode * GetActiveNode() const
Definition EditPropertyChain.cpp:64
Definition UnrealType.h:174
Definition WorldPartitionActorDescInstance.h:18
Definition ILevelInstanceEditorModule.h:46
virtual UObject * GetArchetypeForObject(const UObject *Object) const =0
virtual bool CanEditProperty(const FEditPropertyChain &PropertyChain, const UObject *Object) const =0
Definition ILevelInstanceEditorModule.h:14
Definition LevelInstanceInterface.h:33
Definition Array.h:670
Definition ActorDescContainerInstance.h:23
Definition LevelInstancePropertyOverrideAsset.h:32
Definition LevelInstancePropertyOverridePolicy.h:13
Definition LevelInstanceSubsystem.h:55
Definition LevelStreamingDynamic.h:21
Definition LevelInstanceEditorPropertyOverrideLevelStreaming.h:20
Definition Level.h:423
Definition Object.h:95
Definition World.h:918
Definition AsyncRegisterLevelContext.cpp:16
Definition LevelInstanceTypes.h:14
Definition UnrealType.h:6865
Definition ObjectPtr.h:488
Definition Optional.h:131