Manager that provides functionality for managing streaming levels. Two options to use this class:
More...
#include <StreamingLevelManager.h>
|
| UStreamingLevelManager () |
|
| DECLARE_EVENT_HANDLER (UNewStepLoadedEvent) |
|
| DECLARE_EVENT_HANDLER (UNewStoryLoadedEvent) |
|
TArray< FName > | GetLevelsBasedOnStep (FText StepName) |
| UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
|
|
APlayerController * | GetPrivateOwner () const |
|
void | HandleEvent (UBaseEvent *Event) |
|
void | LoadStreamingLevels (TArray< FName > levelsToLoad, bool onlyFadeOut=false, float FadeTime=0.5f) |
| Calling due to LevelStreamingDataTable, but you also can call it manually. In addition, you can setup AutoFadeInAndOut before calling.
|
|
void | LoadStreamingLevelsAndTeleportPlayer (TArray< FName > Levels, FTransform PlayerTransform, bool OnlyFadeOut=false, float FadeTime=0.5f) |
| Call it manually, if you want to teleport player to specific location after loading levels.
|
|
template<typename TEventType , typename... TInitializeArgs> |
void | SendEvent (TInitializeArgs... Arguments) |
|
void | SetLevelsVisibility (TArray< FName > Levels, bool Visible) |
| UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
|
|
void | SetPrivateOwner (APlayerController *Owner) |
|
|
bool | AutoFadeInAndOut = true |
| UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LevelStreamingManager")
|
|
UDataTable * | LevelStreamingDataTable |
| UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LevelStreamingManager")
|
|
TArray< FName > | LoadedLevels |
| UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "LevelStreamingManager")
|
|
|
void | FilteredArraysToLoadUnload (TArray< FName > levelsToLoad) |
| This function takes an array of levels to load and filters the arrays LevelsToLoad and LevelsToUnload accordingly. It compares the provided levels with the currently loaded levels (LoadedLevels) to determine which levels should be loaded and which should be unloaded.
|
|
void | HandleEvent_Impl (class UBaseEvent *Event) |
|
void | LevelLoaded () |
| UFUNCTION()
|
|
void | LevelUnloaded () |
| UFUNCTION()
|
|
void | LoadStreamingLevels (int32 IndexToLoad) |
| This function loads a specific streaming level based on the provided index.
|
|
void | UnloadStreamingLevels (int32 IndexToUnload) |
| This function unloads a specific streaming level based on the provided index.
|
|
Manager that provides functionality for managing streaming levels. Two options to use this class:
- Using with StoryManager, when step change it would activate level loading you must attach data table to LevelStreamingDataTable, struct for the data table is FStreamingLevel
- Manually load levels using LoadStreamingLevels or LoadStreamingLevelsAndTeleportPlayer
UCLASS(Blueprintable)
Definition at line 56 of file StreamingLevelManager.h.
◆ THandler
◆ THandlerKey
◆ THandlers
◆ UStreamingLevelManager()
UStreamingLevelManager::UStreamingLevelManager |
( |
| ) |
|
◆ DECLARE_EVENT_HANDLER() [1/2]
◆ DECLARE_EVENT_HANDLER() [2/2]
◆ FilteredArraysToLoadUnload()
void UStreamingLevelManager::FilteredArraysToLoadUnload |
( |
TArray< FName > | levelsToLoad | ) |
|
|
protectedBlueprintCallable |
This function takes an array of levels to load and filters the arrays LevelsToLoad and LevelsToUnload accordingly. It compares the provided levels with the currently loaded levels (LoadedLevels) to determine which levels should be loaded and which should be unloaded.
- Parameters
-
levelsToLoad | The array of levels to load. |
UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
Definition at line 53 of file StreamingLevelManager.cpp.
◆ GENERATED_BODY()
UStreamingLevelManager::GENERATED_BODY |
( |
| ) |
|
|
private |
◆ GetLevelsBasedOnStep()
TArray< FName > UStreamingLevelManager::GetLevelsBasedOnStep |
( |
FText | StepName | ) |
|
|
BlueprintCallable |
UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
Retrieves levels based on the step name.
Definition at line 20 of file StreamingLevelManager.cpp.
◆ GetPrivateOwner()
◆ HandleEvent()
void UBaseManager::HandleEvent |
( |
UBaseEvent * | Event | ) |
|
|
inherited |
◆ HandleEvent_Impl()
void UBaseManager::HandleEvent_Impl |
( |
class UBaseEvent * | Event | ) |
|
|
protectedinherited |
◆ LevelLoaded()
void UStreamingLevelManager::LevelLoaded |
( |
| ) |
|
|
protected |
◆ LevelUnloaded()
void UStreamingLevelManager::LevelUnloaded |
( |
| ) |
|
|
protected |
◆ LoadStreamingLevels() [1/2]
void UStreamingLevelManager::LoadStreamingLevels |
( |
int32 | IndexToLoad | ) |
|
|
protected |
This function loads a specific streaming level based on the provided index.
- Parameters
-
IndexToLoad | The index of the level to load. |
Definition at line 215 of file StreamingLevelManager.cpp.
◆ LoadStreamingLevels() [2/2]
void UStreamingLevelManager::LoadStreamingLevels |
( |
TArray< FName > | levelsToLoad, |
|
|
bool | onlyFadeOut = false, |
|
|
float | FadeTime = 0.5f ) |
|
BlueprintCallable |
Calling due to LevelStreamingDataTable, but you also can call it manually. In addition, you can setup AutoFadeInAndOut before calling.
- Parameters
-
levelsToLoad | Levels you want to load |
onlyFadeOut | Do only Fade Out (useful when you load the first level) |
FadeTime | Optional param for custom fade time |
UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
Definition at line 77 of file StreamingLevelManager.cpp.
◆ LoadStreamingLevelsAndTeleportPlayer()
void UStreamingLevelManager::LoadStreamingLevelsAndTeleportPlayer |
( |
TArray< FName > | Levels, |
|
|
FTransform | PlayerTransform, |
|
|
bool | OnlyFadeOut = false, |
|
|
float | FadeTime = 0.5f ) |
|
BlueprintCallable |
Call it manually, if you want to teleport player to specific location after loading levels.
- Parameters
-
Levels | Levels you want to load |
OnlyFadeOut | Do only Fade Out (useful when you load the first level) |
PlayerTransform | The transform where you want the player to be after loading |
FadeTime | Optional param for custom fade time |
UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
Definition at line 136 of file StreamingLevelManager.cpp.
◆ SendEvent()
template<typename TEventType , typename... TInitializeArgs>
void UBaseManager::SendEvent |
( |
TInitializeArgs... | Arguments | ) |
|
|
inlineinherited |
◆ SetLevelsVisibility()
void UStreamingLevelManager::SetLevelsVisibility |
( |
TArray< FName > | Levels, |
|
|
bool | Visible ) |
|
BlueprintCallable |
UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
Sets the visibility of levels.
Definition at line 144 of file StreamingLevelManager.cpp.
◆ SetPrivateOwner()
◆ UnloadStreamingLevels()
void UStreamingLevelManager::UnloadStreamingLevels |
( |
int32 | IndexToUnload | ) |
|
|
protected |
This function unloads a specific streaming level based on the provided index.
- Parameters
-
IndexToUnload | The index of the level to unload. |
Definition at line 174 of file StreamingLevelManager.cpp.
◆ AutoFadeInAndOut
bool UStreamingLevelManager::AutoFadeInAndOut = true |
|
BlueprintReadWriteEditAnywhere |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LevelStreamingManager")
Determines if automatic fade in and out effects should be used when loading new levels.
Definition at line 124 of file StreamingLevelManager.h.
◆ Handlers
◆ LevelsToLoad
TArray<FName> UStreamingLevelManager::LevelsToLoad |
|
protected |
◆ LevelsToUnload
TArray<FName> UStreamingLevelManager::LevelsToUnload |
|
protected |
◆ LevelStreamingDataTable
UDataTable* UStreamingLevelManager::LevelStreamingDataTable |
|
BlueprintReadWriteEditAnywhere |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LevelStreamingManager")
Data table with levels for loading based on step.
Definition at line 110 of file StreamingLevelManager.h.
◆ LoadedLevels
TArray<FName> UStreamingLevelManager::LoadedLevels |
|
VisibleAnywhereBlueprintReadOnly |
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "LevelStreamingManager")
Array storing the currently loaded levels.
Definition at line 117 of file StreamingLevelManager.h.
◆ LoadingIndex
int32 UStreamingLevelManager::LoadingIndex |
|
protected |
◆ PlayerNewTransform
FTransform UStreamingLevelManager::PlayerNewTransform |
|
protected |
Transform representing the new location for the player after loading levels.
Definition at line 163 of file StreamingLevelManager.h.
◆ PrivateOwner
◆ TeleportPlayerToSpecificLocation
bool UStreamingLevelManager::TeleportPlayerToSpecificLocation = false |
|
protected |
Determines whether to teleport the player to a specific location after loading levels.
Definition at line 162 of file StreamingLevelManager.h.
◆ TimeForFades
float UStreamingLevelManager::TimeForFades |
|
private |
◆ UnloadingIndex
int32 UStreamingLevelManager::UnloadingIndex |
|
protected |
The documentation for this class was generated from the following files: