Project Arrhythmia
A video game developed by Vitamin Games.
Loading...
Searching...
No Matches
Systems.SceneManagement.SceneLoader Class Reference

This class manages the loading and unloading of scenes, including persistent scenes and scene groups. More...

+ Inheritance diagram for Systems.SceneManagement.SceneLoader:

Classes

class  SceneTypesClass
 

Public Member Functions

override void OnAwake ()
 
string BuildLoadingBar (float _amount=0)
 Builds a visual representation of the loading progress bar.
 
string BuildLoadingText (float _progress=0, List< TaskData > _tasks=null)
 Builds a textual representation of the loading status, including progress and task details.
 
bool DoesSceneExist (string _name)
 Checks if a scene exists within the scene groups.
 
void LoadSceneGroup (string _name)
 Loads a group of scenes by name, adding them to the current scene.
 
void pickTip ()
 
async Task LoadSceneGroup (int index)
 
- Public Member Functions inherited from SingletonBase< SceneLoader >
virtual void Awake ()
 

Public Attributes

bool DebugLogs = true
 
SceneTypesClass SceneTypeInfos
 
bool isLoading
 
readonly SceneGroupManager manager = new SceneGroupManager()
 
- Public Attributes inherited from SingletonBase< SceneLoader >
bool DestroySingleton
 

Private Member Functions

async void Start ()
 
int GetInitialSceneGroupIndex ()
 
async void Update ()
 
async Task LoadPersistentScenes ()
 
void EnableLoadingCanvas (bool enable=true)
 

Private Attributes

Camera loadingCamera
 
TextMeshProUGUI loadingText
 
TextMeshProUGUI loadingBar
 
Canvas loadingCanvas
 
LocalizedString loadingTextBase
 
int barLength = 10
 
string music
 
string[] Tips
 
SceneGroup persistentScenes
 
SceneGroup[] sceneGroups
 
int currentTipIndex = 0
 
float targetProgress
 
int levelTest
 
List< string > CompletedExtras = new List<string>()
 
StringBuilder sb = new StringBuilder()
 

Additional Inherited Members

- Properties inherited from SingletonBase< SceneLoader >
static T Inst [get]
 

Detailed Description

This class manages the loading and unloading of scenes, including persistent scenes and scene groups.

It handles the loading of scenes that are always needed, as well as the loading of different scene groups based on the game's progression. It provides functions to load specific scene groups or individual scenes within a group. The class also includes a loading screen with progress bar and text updates.

Member Function Documentation

◆ BuildLoadingBar()

public string Systems.SceneManagement.SceneLoader.BuildLoadingBar ( float _amount = 0)

Builds a visual representation of the loading progress bar.

This method generates a string that visually represents the progress of loading operations. The progress bar is constructed using two different characters to indicate loaded and remaining portions.

Parameters
_amountA float representing the current progress as a fraction (0 to 1).
Returns
A string representing the visual loading bar.
Note
The length of the progress bar is determined by the barLength member variable.

◆ BuildLoadingText()

public string Systems.SceneManagement.SceneLoader.BuildLoadingText ( float _progress = 0,
List< TaskData > _tasks = null )

Builds a textual representation of the loading status, including progress and task details.

This method generates a string that provides detailed information about the loading status, including the overall progress and the status of individual tasks if provided. It's designed to give a comprehensive overview of the loading process, suitable for debugging or user feedback.

Parameters
_progressA float representing the current loading progress as a fraction (0 to 1).
_tasksAn optional list of TaskData objects representing individual loading tasks and their statuses.
Returns
A string containing detailed loading status information.
Note
This method utilizes the loadingTextBase member variable for the base text, which can be localized.

◆ DoesSceneExist()

public bool Systems.SceneManagement.SceneLoader.DoesSceneExist ( string _name)

Checks if a scene exists within the scene groups.

This method searches through the available scene groups to determine if a scene with the specified name exists. It's useful for validating scene names before attempting to load them, preventing errors related to non-existent scenes.

Parameters
_nameA string representing the name of the scene to check.
Returns
A boolean value indicating whether the scene exists (true) or not (false).

◆ LoadSceneGroup()

public void Systems.SceneManagement.SceneLoader.LoadSceneGroup ( string groupName)

Loads a group of scenes by name, adding them to the current scene.

This method is responsible for loading a predefined group of scenes, identified by a group name. It allows for multiple scenes to be loaded and added to the current scene context, enabling complex scene compositions. This is particularly useful in modular game designs where different parts of the game are split across multiple scenes but need to be loaded simultaneously.

Parameters
groupNameA string representing the name of the scene group to load.
Note
This method assumes that the groupName corresponds to a valid configuration of scene names. It does not check for the existence of the scenes before attempting to load them.

◆ OnAwake()

override void Systems.SceneManagement.SceneLoader.OnAwake ( )
virtual

Reimplemented from SingletonBase< SceneLoader >.

Member Data Documentation

◆ Tips

string [] Systems.SceneManagement.SceneLoader.Tips
private
Initial value:
= new string[5]{
"Use your boost to get out of tight situations",
"Use practice mode to learn the layout of a log without the pain of dying",
"Back for more are ya?",
"Tip 4",
"Tip 5"
}

The documentation for this class was generated from the following file: