![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <World.h>
Public Member Functions | |
| UE_API | FScopedLevelCollectionContextSwitch (const FLevelCollection *const InLevelCollection, UWorld *const InWorld) |
| UE_API | FScopedLevelCollectionContextSwitch (int32 InLevelCollectionIndex, UWorld *const InWorld) |
| UE_API | ~FScopedLevelCollectionContextSwitch () |
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.
| FScopedLevelCollectionContextSwitch::FScopedLevelCollectionContextSwitch | ( | const FLevelCollection *const | InLevelCollection, |
| UWorld *const | InWorld | ||
| ) |
Constructor that will save the current relevant values of InWorld and set the collection's context values for InWorld. The constructor that takes an index is preferred, but this one still exists for backwards compatibility.
| InLevelCollection | The collection's context to use |
| InWorld | The world on which to set the context. |
| FScopedLevelCollectionContextSwitch::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.
| InLevelCollectionIndex | The index of the collection to use |
| InWorld | The world on which to set the context. |
| FScopedLevelCollectionContextSwitch::~FScopedLevelCollectionContextSwitch | ( | ) |
The destructor restores the context on the world that was saved in the constructor.