A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
StreamingLevelManager.h
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "Engine/DataTable.h"
8#include "StreamingLevelManager.generated.h"
9
13USTRUCT(BlueprintType)
14struct FStreamingLevel : public FTableRowBase
15{
17 UPROPERTY(EditAnywhere, BlueprintReadOnly)
19 UPROPERTY(EditAnywhere, BlueprintReadOnly)
20 TArray<FName> ActiveLevels;
21 UPROPERTY(EditAnywhere, BlueprintReadWrite)
23 UPROPERTY(EditAnywhere, BlueprintReadWrite)
24 FTransform PlayerNewLocation;
25};
26
33UCLASS(Blueprintable)
34class PIXOCORE_API UStreamingLevelManager : public UBaseManager
35{
38public:
39 // Manager event declaration
42
43public:
45
46 UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
47 TArray<FName> GetLevelsBasedOnStep(FText StepName);
48
55 UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
56 void LoadStreamingLevels(TArray<FName> levelsToLoad, bool onlyFadeOut = false, float FadeTime = 0.5f);
57
65 UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
66 void LoadStreamingLevelsAndTeleportPlayer(TArray<FName> Levels, FTransform PlayerTransform, bool OnlyFadeOut = false, float FadeTime = 0.5f);
67
68 UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
69 void SetLevelsVisibility(TArray<FName> Levels, bool Visible);
70
71 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LevelStreamingManager")
72 UDataTable* LevelStreamingDataTable;
73
74 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "LevelStreamingManager")
75 TArray<FName> LoadedLevels;
76
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LevelStreamingManager")
78 bool AutoFadeInAndOut = true;
79
80protected:
86 UFUNCTION(BlueprintCallable, Category = "LevelStreamingManager")
87 void FilteredArraysToLoadUnload(TArray<FName> levelsToLoad);
88 UFUNCTION()
89 void LevelLoaded();
90 UFUNCTION()
91 void LevelUnloaded();
92
97 void UnloadStreamingLevels(int32 IndexToUnload);
102 void LoadStreamingLevels(int32 IndexToLoad);
103
104 TArray<FName> LevelsToLoad;
105 TArray<FName> LevelsToUnload;
106 int32 LoadingIndex;
107 int32 UnloadingIndex;
108
110 FTransform PlayerNewTransform;
111
112private:
113 float TimeForFades;
114};
#define DECLARE_EVENT_HANDLER(TEvent)
Definition BaseManager.h:11
It provides functionalities for handling events, sending events, and managing a private owner....
Definition BaseManager.h:32
Event called when new step is loaded.
Event called when new story is loaded.
Manager that provides functionality for managing streaming levels. Two options to use this class:
DECLARE_EVENT_HANDLER(UNewStoryLoadedEvent)
DECLARE_EVENT_HANDLER(UNewStepLoadedEvent)
TArray< FName > LevelsToLoad
Array storing the levels to load.
TArray< FName > LoadedLevels
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "LevelStreamingManager")
TArray< FName > LevelsToUnload
Array storing the levels to unload.
UDataTable * LevelStreamingDataTable
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LevelStreamingManager")
int32 LoadingIndex
Index for tracking the loading progress.
FTransform PlayerNewTransform
Transform representing the new location for the player after loading levels.
int32 UnloadingIndex
Index for tracking the unloading progress.
float TimeForFades
Time duration for fade effects.
Structure representing streaming levels to load based on step. Also contains info about new player po...
bool TeleportPlayerToSpecificLocation
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray< FName > ActiveLevels
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FText StepName
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FTransform PlayerNewLocation
UPROPERTY(EditAnywhere, BlueprintReadWrite)