Navigation
API > API/Runtime > API/Runtime/Engine
When created, switches global context to a PIE world When destroyed, resets the GWorld back to what it was before
| Name | FScopedConditionalWorldSwitcher |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/UnrealEngine.h |
| Include Path | #include "UnrealEngine.h" |
Syntax
class FScopedConditionalWorldSwitcher
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FScopedConditionalWorldSwitcher
(
FViewportClient* InViewportClient |
Use the viewport to figure out what world to set temporarily | UnrealEngine.h | |
FScopedConditionalWorldSwitcher
(
UWorld* InWorld |
Explicitly set to the specific world | UnrealEngine.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FScopedConditionalWorldSwitcher() |
Resets back to initial world | UnrealEngine.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| SwitchWorldForPIEDelegate | FOnSwitchWorldForPIE | Delegate to call to switch worlds for PIE viewports. | UnrealEngine.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OldWorld | UWorld * | World to reset when this is destroyed. Can be null if nothing needs to be reset | UnrealEngine.h | |
| ViewportClient | FViewportClient * | Viewport client used to set the world | UnrealEngine.h |