This class can read and write World Variables in the current Scene.
More...
|
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...
|
|
This class can read and write World Variables in the current Scene.
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 |
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
-
variableName | World Variable name. |
startingValue | The 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
-
variableName | World Variable name. |
startingValue | The 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
-
statName | The 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
-
modifier | Modifier. |
sourceTrans | Source 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
-
statName | World Variable name |
- Returns
- boolean
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:
- DarkSpawner/Assets/Plugins/DarkTonic/CoreGameKit/Scripts/WorldVariables/WorldVariableTracker.cs