PixelCrushers.DialogueSystem.LevelManager Class Reference

This component combines Application.LoadLevel[Async] with the saved-game data features of PersistentDataManager. More...

Inheritance diagram for PixelCrushers.DialogueSystem.LevelManager:
Collaboration diagram for PixelCrushers.DialogueSystem.LevelManager:

Public Member Functions

void LoadGame (string saveData)
 Loads the game recorded in the provided saveData.
 
void RestartGame ()
 Restarts the game at the default starting level and resets the Dialogue System to its initial database state.
 
void LoadLevel (string levelName)
 Loads a level.
 
void LoadLevel (int levelIndex)
 Loads a level.
 
virtual void OnRecordPersistentData ()
 Records the current level in Lua.
 

Public Attributes

string defaultStartingLevel
 The default starting level to use if none is recorded in the saved-game data.
 
bool useAsyncLoad = true
 

Protected Member Functions

virtual void Awake ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 

Properties

bool isLoading [get]
 Indicates whether a level is currently loading.
 

Detailed Description

This component combines Application.LoadLevel[Async] with the saved-game data features of PersistentDataManager.

To use it, add it to your Dialogue Manager object and pass the saved-game data to LevelManager.LoadGame().

Member Function Documentation

◆ Awake()

virtual void PixelCrushers.DialogueSystem.LevelManager.Awake ( )
inlineprotectedvirtual

◆ LoadGame()

void PixelCrushers.DialogueSystem.LevelManager.LoadGame ( string  saveData)
inline

Loads the game recorded in the provided saveData.

Parameters
saveDataSave data.

◆ LoadLevel() [1/2]

void PixelCrushers.DialogueSystem.LevelManager.LoadLevel ( int  levelIndex)
inline

Loads a level.

Use to change levels while keeping data synced. This method also calls PersistentDataManager.Record() before changing levels and PersistentDataManager.Apply() after changing levels. After loading the level, it waits two frames to allow GameObjects to finish their initialization first.

Parameters
levelIndexScene index in build settings.

◆ LoadLevel() [2/2]

void PixelCrushers.DialogueSystem.LevelManager.LoadLevel ( string  levelName)
inline

Loads a level.

Use to change levels while keeping data synced. This method also calls PersistentDataManager.Record() before changing levels and PersistentDataManager.Apply() after changing levels. After loading the level, it waits two frames to allow GameObjects to finish their initialization first.

Parameters
levelNameLevel name.

◆ OnDisable()

virtual void PixelCrushers.DialogueSystem.LevelManager.OnDisable ( )
inlineprotectedvirtual

◆ OnEnable()

virtual void PixelCrushers.DialogueSystem.LevelManager.OnEnable ( )
inlineprotectedvirtual

◆ OnRecordPersistentData()

virtual void PixelCrushers.DialogueSystem.LevelManager.OnRecordPersistentData ( )
inlinevirtual

Records the current level in Lua.

◆ RestartGame()

void PixelCrushers.DialogueSystem.LevelManager.RestartGame ( )
inline

Restarts the game at the default starting level and resets the Dialogue System to its initial database state.

Member Data Documentation

◆ defaultStartingLevel

string PixelCrushers.DialogueSystem.LevelManager.defaultStartingLevel

The default starting level to use if none is recorded in the saved-game data.

◆ useAsyncLoad

bool PixelCrushers.DialogueSystem.LevelManager.useAsyncLoad = true

Property Documentation

◆ isLoading

bool PixelCrushers.DialogueSystem.LevelManager.isLoading
get

Indicates whether a level is currently loading.

Only useful in Unity Pro, which uses Application.LoadLevelAsync().

true if loading; otherwise, false.


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