UnitStatsProvider
Last updated
Last updated
A way of providing stats to units.
Inherits from MonoBehaviour.
Name | Description | Type |
---|---|---|
Sets the current value of a stat.
Parameters
Name | Description | Type |
---|---|---|
Return Type: float
Increases a stat's current value by an amount. Returns the excess amount.
Parameters
Return Type: float
Decreases a stat's current value by an amount. Returns the excess amount.
Parameters
Return Type: UpgradableStat
Gets a stat by name.
Parameters
Increases the unit's level by 1.
Decreases the unit's level by 1.
Sets the unit's level.
Parameters
Recalculates all stats.
Resets all stat current values.
Name | Description | Type |
---|---|---|
Name | Description | Type |
---|---|---|
Name | Description | Type |
---|---|---|
Name | Description | Type |
---|---|---|
data
Unit stats data.
UnitStats
onStatChanged
Called whenever a stat's current value is changed.
UnityEvent<UpgradableStat>
onStatReachedMin
Called whenever a stat's current value reaches its min value.
UnitEvent<UpgradableStat>
onStatReachedMax
Called whenever a stat's current value reaches its max value.
UnitEvent<UpgradableStat>
onStatLevelChanged
Called whenever a stat's level is changed.
UnitEvent<UpgradableStat>
level
The level of the unit.
int
name
The name of the stat.
string
newValue
The value to set to.
float
name
The name of the stat.
string
amount
The amount to increase.
float
name
The name of the stat.
string
amount
The amount to decrease.
float
name
The name of the stat.
string
level
The level to set to.
int