Ejemplo n.º 1
0
    public void ResetStat(StatType type, params StatModifierOption[] statOptions)
    {
        List <StatModifierOption> options = ConvertStatOptionsToList(statOptions);

        BaseStat targetStat = GetStat(type);

        if (targetStat == null)
        {
            Debug.Log("Stat: " + type + " not found");
            return;
        }

        if (options.Contains(StatModifierOption.Cap))
        {
            CappedStat capped = TryConvertToCappedStat(targetStat);

            if (capped != null)
            {
                capped.ResetCap();
                OnStatChanged(type, null);
            }
        }

        if ((options.Count < 1 || options.Contains(StatModifierOption.Base)))
        {
            targetStat.Reset();
            OnStatChanged(type, null);
        }
    }
Ejemplo n.º 2
0
 public void ResetCap()
 {
     maxValue.Reset();
 }