Unit Stats Provider
Scripting with the UnitStatsProvider class.
The UnitStatsProvider
class is used to provide stats to GameObjects
. It will be necessary to manage the stats through code at runtime. In the examples below, unitStatsProvider
is an instance of a UnitStatsProvider
.
Getting Stats
You can get a stat by its name or abbreviation.
Alternatively, you can access all stats with data.stats
.
Updating Stats
Stat values can be set with the SetStat
method.
You can increase a stat by a certain amount with the IncreaseStat
method.
A stat's value can be decreased with the DecreaseStat
method.
To reset all stats, call the ResetAllStats
method.
Leveling
When the level of a UnitStatsProvider
is changed, all of its stats level's will be adjusted to match.
SetLevel
Set the level with the SetLevel
method.
LevelUp
Call LevelUp
to increase the level by 1.
LevelDown
Use LevelDown
to have the opposite effect.
Last updated