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...
Public Types | |
enum | IncrementOn { Destroy , Disable , Manually } |
Public Member Functions | |
virtual void | OnEnable () |
Only listen for OnDestroy if the script has been enabled. | |
virtual void | OnLevelWillBeUnloaded () |
If the level is being unloaded, this GameObject will be destroyed. | |
virtual void | OnApplicationQuit () |
If the application is ending, don't listen, as this can log errors in the console. | |
virtual void | OnDestroy () |
When this object is destroyed, increment the counter and update the quest tracker if incrementOn is set to Destroy. | |
virtual void | OnDisable () |
When this object is disabled, increment the counter and update the quest tracker if incrementOn is set to Disable. | |
virtual void | TryIncrement () |
Try to increment variable if conditions are met. | |
Public Attributes | |
IncrementOn | incrementOn = IncrementOn.Destroy |
string | variable = string.Empty |
The variable to increment. | |
int | increment = 1 |
The increment amount. | |
int | min = 0 |
The minimum value. | |
int | max = 100 |
The maximum value. | |
string | alertMessage = string.Empty |
float | alertDuration = 0 |
Condition | condition = new Condition() |
UnityEvent | onIncrement = new UnityEvent() |
Protected Member Functions | |
virtual void | Awake () |
virtual bool | CanIncrement () |
Are the conditions correct to increment? | |
virtual void | IncrementNow () |
Increments variable. | |
Protected Attributes | |
bool | listenForOnDestroy = false |
bool | awakeMarkedForDestroy = false |
Properties | |
virtual string | actualVariableName [get] |
string | ActualVariableName [get] |
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.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Are the conditions correct to increment?
|
inlineprotectedvirtual |
Increments variable.
Assumes conditions to increment have already been checked and passed.
|
inlinevirtual |
If the application is ending, don't listen, as this can log errors in the console.
|
inlinevirtual |
When this object is destroyed, increment the counter and update the quest tracker if incrementOn is set to Destroy.
|
inlinevirtual |
When this object is disabled, increment the counter and update the quest tracker if incrementOn is set to Disable.
|
inlinevirtual |
Only listen for OnDestroy if the script has been enabled.
|
inlinevirtual |
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.
|
inlinevirtual |
Try to increment variable if conditions are met.
float PixelCrushers.DialogueSystem.IncrementOnDestroy.alertDuration = 0 |
string PixelCrushers.DialogueSystem.IncrementOnDestroy.alertMessage = string.Empty |
|
protected |
int PixelCrushers.DialogueSystem.IncrementOnDestroy.increment = 1 |
The increment amount.
To decrement, use a negative number.
IncrementOn PixelCrushers.DialogueSystem.IncrementOnDestroy.incrementOn = IncrementOn.Destroy |
|
protected |
int PixelCrushers.DialogueSystem.IncrementOnDestroy.max = 100 |
The maximum value.
int PixelCrushers.DialogueSystem.IncrementOnDestroy.min = 0 |
The minimum value.
UnityEvent PixelCrushers.DialogueSystem.IncrementOnDestroy.onIncrement = new UnityEvent() |
string PixelCrushers.DialogueSystem.IncrementOnDestroy.variable = string.Empty |
The variable to increment.
|
getprotected |
|
getprotected |