UnitStats
Contains stats data for units.
Properties
Name | Description | Type |
---|---|---|
unitName | The name of this unit. | string |
unitLevel | The level of this unit. It's recommended to use UnitStats.LevelUp or UnitStats.LevelDown to change this value. | int |
stats | A list of upgradable stats for this unit. | List<UpgradableStat> |
Methods
Initialize
Initializes the stats. This is called automatically by the UnitStatsProvider component.
Parameters
Name | Description | Type |
---|---|---|
statsProviderReference | The UnitStatsProvider reference. | UnitStatsProvider |
SetLevel
Sets the unit's level.
Parameters
Name | Description | Type |
---|---|---|
level | The level to set to. | int |
UpdateStats
Updates stat values so that they reflect the unit's level.
ResetStats
Resets all stats. This will remove all combined stats.
AddStat
Adds an upgradable stat.
Parameters
Name | Description | Type |
---|---|---|
stat | The upgradable stat to add. | UpgradableStat |
RemoveStat
Removes an upgradable stat by name.
Parameters
Name | Description | Type |
---|---|---|
name | The name or short name of the stat's identity. | string |
RemoveStat
Removes an upgradable stat by index.
Parameters
Name | Description | Type |
---|---|---|
index | The stat index. | int |
Last updated