Methods & Functions
Overview
The different methods and functions available within the system
Achievements
GetAchievement (int id)
Retrieves an achievement by its ID. Returns
null
if not found.
GetAchievement (string nameOfAchievement)
Retrieves an achievement by its name. Returns
null
if not found.
AddValueToAchievement (int id, int amount)
Increments the progress value of a numerical achievement by a specified amount.
AddValueToAchievement (string achievementName, int amount)
Increments the progress value of a numerical achievement by a specified amount using achievement's name.
UnlockSecretAchievement (string nameOfAchievement)
Unlocks a secret achievement by its name.
UnlockSecretAchievement (int id)
Unlocks a secret achievement by its ID.
CheckForCompletion (Achievement achievement)
Checks if an achievement's progress meets its completion criteria.
GiveAchievement (Achievement achievement)
Marks an achievement as completed and triggers related events.
GiveAchievement (int id)
Marks an achievement as completed by its ID.
GiveAchievement (string nameOfAchievement)
Marks an achievement as completed by its name.
RemoveAchievement (Achievement achievement, bool resetTotalValue)
Resets an achievement's completion status and optionally its progress value.
LoadAchievementFile (bool demo)
Loads achievements from a JSON file. If no file exists, loads demo data.
SaveAchievementFile (List<Achievement> achievementList)
Saves the current state of achievements to a JSON file.
Stats
ActivateAllStatTimeSpanRoutines
Starts tracking time for all stats marked as TimeSpan and set to be tracked.
EnableSingleStatTimeSpanRoutine (string NameOfStat)
Activates time tracking for a single stat identified by its name.
EnableSingleStatTimeSpanRoutine (int id)
Activates time tracking for a single stat identified by its ID.
StopAllStatTimeSpanRoutines
Stops time tracking for all stats and clears the coroutine references.
StopSingleStatTimeSpanRoutine (int id)
Stops time tracking for a single stat identified by its ID.
StopSingleStatTimeSpanRoutine (string NameOfStat)
Stops time tracking for a single stat identified by its name.
TrackStatTimespan
Coroutine that tracks time for a stat and handles autosave if enabled.
GetStat (int id)
Retrieves a stat by its ID. Returns
null
if not found.
GetStat (string nameOfStat)
Retrieves a stat by its name. Returns
null
if not found.
ReturnStatCurrentValue (string statName)
Returns the current value of a stat identified by its name.
ReturnStatCurrentValue (int statId)
Returns the current value of a stat identified by its ID.
IncrementStat (string statName, float amount)
Increments the value of a numerical stat by a specified amount using its name.
IncrementStat (int statId, float amount)
Increments the value of a numerical stat by a specified amount using its ID.
DecreaseStat (string statName, float amount)
Decreases the value of a numerical stat by a specified amount using its name.
DecreaseStat (int statId, float amount)
Decreases the value of a numerical stat by a specified amount using its ID.
SetStatToValue (string statName, float amount)
Sets the value of a numerical stat to a specified amount using its name.
SetStatToValue (int statId, float amount)
Sets the value of a numerical stat to a specified amount using its ID.
ResetAllStats
Resets the value of all stats to zero.
LoadStats
Loads stat data from a JSON file.
SaveStats
Saves the current state of stats to a JSON file.
Last updated