PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel Class Reference

This component should usually be added to the Dialogue Manager object, not the player object! This is because it needs to persist across level loads. More...

Inheritance diagram for PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel:
Collaboration diagram for PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel:

Public Member Functions

virtual void OnEnable ()
 
virtual void OnDisable ()
 
void OnSceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 After a level is loaded, reapply the recorded persistent data from Lua. More...
 
virtual void CheckAndApplyLua ()
 After a level is loaded, reapply the recorded persistent data from Lua. More...
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
void OnSceneLoaded (UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 After a level is loaded, reapply the recorded persistent data from Lua. More...
 
virtual void CheckAndApplyLua ()
 After a level is loaded, reapply the recorded persistent data from Lua. More...
 

Public Attributes

bool dontApplyLuaNextLoadLevel = false
 Set true to skip applying the player's saved info from Lua on the next level load. More...
 

Detailed Description

This component should usually be added to the Dialogue Manager object, not the player object! This is because it needs to persist across level loads.

This component syncs the player's saved Lua data to the Realistic FPS player components after a level has loaded. The player's position is not sync'ed, but stats and inventory are.

Member Function Documentation

◆ CheckAndApplyLua() [1/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.CheckAndApplyLua ( )
virtual

After a level is loaded, reapply the recorded persistent data from Lua.

Parameters
levelLevel just loaded.

◆ CheckAndApplyLua() [2/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.CheckAndApplyLua ( )
virtual

After a level is loaded, reapply the recorded persistent data from Lua.

Parameters
levelLevel just loaded.

◆ OnDisable() [1/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.OnDisable ( )
virtual

◆ OnDisable() [2/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.OnDisable ( )
virtual

◆ OnEnable() [1/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.OnEnable ( )
virtual

◆ OnEnable() [2/2]

virtual void PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.OnEnable ( )
virtual

◆ OnSceneLoaded() [1/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.OnSceneLoaded ( UnityEngine.SceneManagement.Scene  scene,
UnityEngine.SceneManagement.LoadSceneMode  mode 
)

After a level is loaded, reapply the recorded persistent data from Lua.

Parameters
levelLevel just loaded.

◆ OnSceneLoaded() [2/2]

void PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.OnSceneLoaded ( UnityEngine.SceneManagement.Scene  scene,
UnityEngine.SceneManagement.LoadSceneMode  mode 
)

After a level is loaded, reapply the recorded persistent data from Lua.

Parameters
levelLevel just loaded.

Member Data Documentation

◆ dontApplyLuaNextLoadLevel

bool PixelCrushers.DialogueSystem.RealisticFPSPrefab.SyncLuaToFPSOnLoadLevel.dontApplyLuaNextLoadLevel = false

Set true to skip applying the player's saved info from Lua on the next level load.

Normally you want to apply the saved info so the player's health, inventory, etc., persist across levels. However, if you're restarting the level with a fresh instance of the player (e.g., the player died and is respawning), set this true or the player will receive his old stats, such as zero health.


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