mirror of
https://github.com/Steffo99/octogem.git
synced 2024-10-16 20:17:26 +00:00
28 lines
766 B
C#
28 lines
766 B
C#
using UnityEngine;
|
|
|
|
[System.Serializable]
|
|
public class UnitStat : System.Object
|
|
{
|
|
public int currentValue;
|
|
public int minimumValue;
|
|
public int maximumValue;
|
|
public readonly int startingValue;
|
|
|
|
public UnitStat(int startingValue, int minimumValue, int maximumValue)
|
|
{
|
|
this.startingValue = startingValue;
|
|
this.minimumValue = minimumValue;
|
|
this.maximumValue = maximumValue;
|
|
currentValue = startingValue;
|
|
}
|
|
|
|
public void RelativeChange(int relativeValue)
|
|
{
|
|
currentValue = Mathf.Clamp(currentValue + relativeValue, minimumValue, maximumValue);
|
|
}
|
|
|
|
public void AbsoluteChange(int absoluteValue)
|
|
{
|
|
currentValue = Mathf.Clamp(absoluteValue, minimumValue, maximumValue);
|
|
}
|
|
}
|