PixelCrushers.DialogueSystem.IncrementOnDestroy Class Reference

Increments an element of the Lua Variable[] table when the GameObject is destroyed or disabled, and then updates the quest tracker if it's attached to the Dialogue Manager object or its children. More...

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

Public Types

enum  IncrementOn { IncrementOn.Destroy, IncrementOn.Disable }
 

Public Member Functions

void OnEnable ()
 Only listen for OnDestroy if the script has been enabled. More...
 
void OnLevelWillBeUnloaded ()
 If the level is being unloaded, this GameObject will be destroyed. More...
 
void OnApplicationQuit ()
 If the application is ending, don't listen, as this can log errors in the console. More...
 
void OnDestroy ()
 When this object is destroyed, increment the counter and update the quest tracker if incrementOn is set to Destroy. More...
 
void OnDisable ()
 When this object is disabled, increment the counter and update the quest tracker if incrementOn is set to Disable. More...
 
void TryIncrement ()
 

Public Attributes

IncrementOn incrementOn = IncrementOn.Destroy
 
string variable = string.Empty
 The variable to increment. More...
 
int increment = 1
 The increment amount. More...
 
int min = 0
 The minimum value. More...
 
int max = 100
 The maximum value. More...
 
string alertMessage = string.Empty
 
float alertDuration = 0
 
Condition condition = new Condition()
 
UnityEvent onIncrement = new UnityEvent()
 

Properties

string? ActualVariableName [get]
 

Detailed Description

Increments an element of the Lua Variable[] table when the GameObject is destroyed or disabled, and then updates the quest tracker if it's attached to the Dialogue Manager object or its children.

This script is useful for kill quests or gathering quests.

Member Enumeration Documentation

◆ IncrementOn

Enumerator
Destroy 
Disable 

Member Function Documentation

◆ OnApplicationQuit()

void PixelCrushers.DialogueSystem.IncrementOnDestroy.OnApplicationQuit ( )

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

◆ OnDestroy()

void PixelCrushers.DialogueSystem.IncrementOnDestroy.OnDestroy ( )

When this object is destroyed, increment the counter and update the quest tracker if incrementOn is set to Destroy.

◆ OnDisable()

void PixelCrushers.DialogueSystem.IncrementOnDestroy.OnDisable ( )

When this object is disabled, increment the counter and update the quest tracker if incrementOn is set to Disable.

◆ OnEnable()

void PixelCrushers.DialogueSystem.IncrementOnDestroy.OnEnable ( )

Only listen for OnDestroy if the script has been enabled.

◆ OnLevelWillBeUnloaded()

void PixelCrushers.DialogueSystem.IncrementOnDestroy.OnLevelWillBeUnloaded ( )

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.

◆ TryIncrement()

void PixelCrushers.DialogueSystem.IncrementOnDestroy.TryIncrement ( )

Member Data Documentation

◆ alertDuration

float PixelCrushers.DialogueSystem.IncrementOnDestroy.alertDuration = 0

◆ alertMessage

string PixelCrushers.DialogueSystem.IncrementOnDestroy.alertMessage = string.Empty

◆ condition

Condition PixelCrushers.DialogueSystem.IncrementOnDestroy.condition = new Condition()

◆ increment

int PixelCrushers.DialogueSystem.IncrementOnDestroy.increment = 1

The increment amount.

To decrement, use a negative number.

◆ incrementOn

IncrementOn PixelCrushers.DialogueSystem.IncrementOnDestroy.incrementOn = IncrementOn.Destroy

◆ max

int PixelCrushers.DialogueSystem.IncrementOnDestroy.max = 100

The maximum value.

◆ min

int PixelCrushers.DialogueSystem.IncrementOnDestroy.min = 0

The minimum value.

◆ onIncrement

UnityEvent PixelCrushers.DialogueSystem.IncrementOnDestroy.onIncrement = new UnityEvent()

◆ variable

string PixelCrushers.DialogueSystem.IncrementOnDestroy.variable = string.Empty

The variable to increment.

Property Documentation

◆ ActualVariableName

string? PixelCrushers.DialogueSystem.IncrementOnDestroy.ActualVariableName
getprotected

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