FScopedLevelCollectionContextSwitch

A helper RAII class to set the relevant context on a [UWorld](API\Runtime\Engine\Engine\UWorld) for a particular [FLevelCollection](API\Runtime\Engine\Engine\FLevelCollection) within a scope.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/World.h

Include

#include "Engine/World.h"

Syntax

class FScopedLevelCollectionContextSwitch

Remarks

A helper RAII class to set the relevant context on a UWorld for a particular FLevelCollection within a scope. The constructor will set the PersistentLevel, GameState, NetDriver, and DemoNetDriver on the world and the destructor will restore the original values.

Constructors

Name Description

Public function

FScopedLevelCollectionContextSwitch

(
    const FLevelCollection*const I...,
    UWorld*const InWorld
)

Constructor that will save the current relevant values of InWorld and set the collection's context values for InWorld.

Public function

FScopedLevelCollectionContextSwitch

(
    int32 InLevelCollectionIndex,
    UWorld*const InWorld
)

Constructor that will save the current relevant values of InWorld and set the collection's context values for InWorld.

Destructors

Name Description

Public function

~FScopedLevelCollectionContextSwitch()

The destructor restores the context on the world that was saved in the constructor.

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