UnitStats

Contains stats data for units.

Properties

NameDescriptionType

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

NameDescriptionType

statsProviderReference

The UnitStatsProvider reference.

UnitStatsProvider

SetLevel

Sets the unit's level.

Parameters

NameDescriptionType

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

NameDescriptionType

stat

The upgradable stat to add.

UpgradableStat

RemoveStat

Removes an upgradable stat by name.

Parameters

NameDescriptionType

name

The name or short name of the stat's identity.

string

RemoveStat

Removes an upgradable stat by index.

Parameters

NameDescriptionType

index

The stat index.

int

Last updated