FScopedConditionalWorldSwitcher

When created, switches global context to a PIE world When destroyed, resets the GWorld back to what it was before

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/UnrealEngine.h

Include

#include "UnrealEngine.h"

Syntax

class FScopedConditionalWorldSwitcher

Remarks

When created, switches global context to a PIE world When destroyed, resets the GWorld back to what it was before

Constructors

Name Description

Public function

FScopedConditionalWorldSwitcher

(
    FViewportClient* InViewportCli...
)

Use the viewport to figure out what world to set temporarily

Public function

FScopedConditionalWorldSwitcher

(
    UWorld* InWorld
)

Explicitly set to the specific world

Destructors

Name Description

Public function

~FScopedConditionalWorldSwitcher()

Resets back to initial world

Constants

Name

Description

SwitchWorldForPIEDelegate

Delegate to call to switch worlds for PIE viewports.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss