Navigation
API > API/Runtime > API/Runtime/Engine
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.
| Name | FScopedLevelCollectionContextSwitch |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/World.h |
| Include Path | #include "Engine/World.h" |
Syntax
class FScopedLevelCollectionContextSwitch
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FScopedLevelCollectionContextSwitch
(
const FLevelCollection*const InLevelCollection, |
Constructor that will save the current relevant values of InWorld and set the collection's context values for InWorld. | Engine/World.h | |
FScopedLevelCollectionContextSwitch
(
int32 InLevelCollectionIndex, |
Constructor that will save the current relevant values of InWorld and set the collection's context values for InWorld. | Engine/World.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FScopedLevelCollectionContextSwitch() |
The destructor restores the context on the world that was saved in the constructor. | Engine/World.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| SavedTickingCollectionIndex | int32 | Engine/World.h | ||
| World | UWorld * | Engine/World.h |