Core GameKit  3.2.9.0
The ultimate pooling / combat / spawning / variable plugin!
DarkTonic.CoreGameKit.WorldVariableTracker Class Reference

This class can read and write World Variables in the current Scene. More...

Inheritance diagram for DarkTonic.CoreGameKit.WorldVariableTracker:

Static Public Member Functions

static bool VariableExistsInScene (string statName)
 Check at runtime whether the World Variable exists in this Scene. More...
 
static void ForceReInit ()
 Will re-initialize all World Variables to their starting value (only for those marked as "Reset To Starting Value"). Called when using LevelSettings.RestartGame and LevelSettings.ContinueGame(); More...
 
static void ModifyPlayerStat (WorldVariableModifier modifier, Transform sourceTrans=null)
 Modifies a World Variable by name. You can set, add, multiply or subtract the value. More...
 
static InGameWorldVariable GetWorldVariable (string statName)
 This returns an instance of the WorldVariable at runtime. More...
 
static int GetExistingWorldVariableIntValue (string variableName, int startingValue)
 Gets the existing world variable value. This should only be used in startup code. Otherwise grab the variable from GetWorldVariable More...
 
static float GetExistingWorldVariableFloatValue (string variableName, float startingValue)
 Gets the existing world variable value. This should only be used in startup code. Otherwise grab the variable from GetWorldVariable More...
 
static void ClearInGamePlayerStats ()
 Deletes the list holding all World Variables. Used by Inspectors only to avoid caching and showing the wrong thing. Do not call this. More...
 
static void FlushAll ()
 This method will flush all World Variable values and write them to a text file for later retrieval. Normally not needed. If you find your variable values get lost, call this before changing Scenes. I've never seen it happen myself. More...
 

Properties

static Dictionary< string, InGameWorldVariableInGamePlayerStats [get]
 A list of all World Variables in the current Scene More...
 

Detailed Description

This class can read and write World Variables in the current Scene.

Member Function Documentation

static void DarkTonic.CoreGameKit.WorldVariableTracker.ClearInGamePlayerStats ( )
static

Deletes the list holding all World Variables. Used by Inspectors only to avoid caching and showing the wrong thing. Do not call this.

static void DarkTonic.CoreGameKit.WorldVariableTracker.FlushAll ( )
static

This method will flush all World Variable values and write them to a text file for later retrieval. Normally not needed. If you find your variable values get lost, call this before changing Scenes. I've never seen it happen myself.

static void DarkTonic.CoreGameKit.WorldVariableTracker.ForceReInit ( )
static

Will re-initialize all World Variables to their starting value (only for those marked as "Reset To Starting Value"). Called when using LevelSettings.RestartGame and LevelSettings.ContinueGame();

static float DarkTonic.CoreGameKit.WorldVariableTracker.GetExistingWorldVariableFloatValue ( string  variableName,
float  startingValue 
)
static

Gets the existing world variable value. This should only be used in startup code. Otherwise grab the variable from GetWorldVariable

Returns
The existing World Variable value in PlayerPrefs.
Parameters
variableNameWorld Variable name.
startingValueThe value to use if not present.
static int DarkTonic.CoreGameKit.WorldVariableTracker.GetExistingWorldVariableIntValue ( string  variableName,
int  startingValue 
)
static

Gets the existing world variable value. This should only be used in startup code. Otherwise grab the variable from GetWorldVariable

Returns
The existing World Variable value in PlayerPrefs.
Parameters
variableNameWorld Variable name.
startingValueThe value to use if not present.
static InGameWorldVariable DarkTonic.CoreGameKit.WorldVariableTracker.GetWorldVariable ( string  statName)
static

This returns an instance of the WorldVariable at runtime.

Parameters
statNameThe World Variable name.
Returns
InGameWorldVariable object
static void DarkTonic.CoreGameKit.WorldVariableTracker.ModifyPlayerStat ( WorldVariableModifier  modifier,
Transform  sourceTrans = null 
)
static

Modifies a World Variable by name. You can set, add, multiply or subtract the value.

Parameters
modifierModifier.
sourceTransSource trans. Optional - this will output in the debug message if the World Variable is not found.
static bool DarkTonic.CoreGameKit.WorldVariableTracker.VariableExistsInScene ( string  statName)
static

Check at runtime whether the World Variable exists in this Scene.

Parameters
statNameWorld Variable name
Returns
boolean

Property Documentation

Dictionary<string, InGameWorldVariable> DarkTonic.CoreGameKit.WorldVariableTracker.InGamePlayerStats
staticget

A list of all World Variables in the current Scene


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