🧡Stats

Overview

Stats are advanced float values that are used to identify Attributes on the Animal and respond to their changes. They are managed on the Stats Component, on a list of Stat.

E.g. if the Health stat gets to zero we can Activate the Death State on the animal.

Properties

Active

Enable/Disable a stat

ID

ID is the Identifier scriptable object used to know which stat is which... the Name of the Scriptable asset works too as the name of the Stat.

Value

Current Value of the stat

Multiplier

Multiplier for the stat. this will modify result of the methods that changes the Value of the stat. This can be used to reduce the Health by half if the Animal has armor, or make double damage if the animal is vulnerable.

Min Value

Minimum Value of the stat

Max Value

Maximum value of the stat

Regenerate

Allows the Stat to Regenerate

Regenerate Rate

How fast the Stat will regenerate

Regenerate Wait Time

When the value of the stat changes, it will wait X amount of time until the Regeneration logic is activated.

Degenerate

Allows the Stat to Degenerate

Degenerate Rate

How fast the stat will degenerate

Degenerate Wait Time

When the value of the stat changes, it will wait X amount of time until the Degeneration logic is activated.

Reset To

When the stat.Reset() method is called the Value will go to the Max or Min Value depending this parameter.

Inmune Time

Time needed to pass so the stat can be modified again.

Events

On [Stat] change

Is invoked when the stat value is changed.

On [Stat] change Normalized

Is invoked when the stat value changes, but with a normalized value, using the Min and Max value stat

On [Stat] Max Value Change

Is invoked when the Stat's Max Value is changed

On [Stat] Active

Is invoked when the stat becomes active

On [Stat] Full

Is invoked when the Stat value is equal to the Max Stat value

On [Stat] Empty

Is invoked when the Stat value is equal to the Min Stat value

On [Stat] Regenerate

Invoked when the Stat is regenerating

On [Stat] Degenerate

Invoked when the stat is degenerating

On [Stat] Below [X]

Invoked when the stat value is below X

On [Stat] Above [Y]

Invoked when the stat value is above X

Last updated