PixelCrushers.DialogueSystem.PersistentDestructible Class Reference

This persistent data component keeps track of when the GameObject has been destroyed or disabled. More...

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

Public Types

enum  RecordOn { Destroy , Disable }
 

Public Member Functions

void OnApplyPersistentData ()
 When applying persistent data, check the variable.
 
void OnLevelWillBeUnloaded ()
 If the level is being unloaded, this GameObject will be destroyed.
 
void OnApplicationQuit ()
 If the application is ending, don't listen, as this can log errors in the console.
 
void OnDestroy ()
 If the GameObject is destroyed, set its Lua variable true.
 
void OnDisable ()
 

Public Attributes

RecordOn recordOn = RecordOn.Destroy
 
string variableName = string.Empty
 Assign a Lua variable name to keep track of whether the GameObject has been destroyed.
 
GameObject spawnWhenDestroyed
 

Protected Member Functions

virtual void OnEnable ()
 Only listen for OnDestroy if the script has been enabled.
 

Protected Attributes

bool listenForOnDestroy = false
 

Properties

string ActualVariableName [get]
 

Detailed Description

This persistent data component keeps track of when the GameObject has been destroyed or disabled.

The next time the level or game is loaded, if the GameObject has previously been destroyed/disabled, this script will destroy/deactivate it again.

Member Enumeration Documentation

◆ RecordOn

Member Function Documentation

◆ OnApplicationQuit()

void PixelCrushers.DialogueSystem.PersistentDestructible.OnApplicationQuit ( )
inline

If the application is ending, don't listen, as this can log errors in the console.

◆ OnApplyPersistentData()

void PixelCrushers.DialogueSystem.PersistentDestructible.OnApplyPersistentData ( )
inline

When applying persistent data, check the variable.

If it's true, the GameObject has been destroyed previously, so destroy it now.

◆ OnDestroy()

void PixelCrushers.DialogueSystem.PersistentDestructible.OnDestroy ( )
inline

If the GameObject is destroyed, set its Lua variable true.

◆ OnDisable()

void PixelCrushers.DialogueSystem.PersistentDestructible.OnDisable ( )
inline

◆ OnEnable()

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

Only listen for OnDestroy if the script has been enabled.

◆ OnLevelWillBeUnloaded()

void PixelCrushers.DialogueSystem.PersistentDestructible.OnLevelWillBeUnloaded ( )
inline

If the level is being unloaded, this GameObject will be destroyed.

We don't want to count this in the variable, so disable the script.

Member Data Documentation

◆ listenForOnDestroy

bool PixelCrushers.DialogueSystem.PersistentDestructible.listenForOnDestroy = false
protected

◆ recordOn

RecordOn PixelCrushers.DialogueSystem.PersistentDestructible.recordOn = RecordOn.Destroy

◆ spawnWhenDestroyed

GameObject PixelCrushers.DialogueSystem.PersistentDestructible.spawnWhenDestroyed

◆ variableName

string PixelCrushers.DialogueSystem.PersistentDestructible.variableName = string.Empty

Assign a Lua variable name to keep track of whether the GameObject has been destroyed.

If this is blank, it uses the name of the GameObject for the variable name. If the variable is true, the GameObject has been destroyed.

Property Documentation

◆ ActualVariableName

string PixelCrushers.DialogueSystem.PersistentDestructible.ActualVariableName
getprotected

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