Exemple #1
0
        private void Start()
        {
            _stats = new DefaultStats();

            DisplayStatValues();

            _stats.GetStat <Attribute>(StatType.Stamina).ScaleStat(5);
            _stats.GetStat <Attribute>(StatType.Wisdom).ScaleStat(10);

            DisplayStatValues();
        }
Exemple #2
0
 void DisplayStatValues()
 {
     ForEachEnum <StatType>((statType) =>
     {
         Stat stat = _stats.GetStat(statType);
         if (stat != null)
         {
             Debug.Log(string.Format("Stat {0}'s value is {1}", stat.Name, stat.Value));
         }
     });
 }
Exemple #3
0
        void DisplayStatValues()
        {
            ForEachEnum <StatType>((statType) =>
            {
                Stat stat = _stats.GetStat(statType);
                if (stat != null)
                {
                    Vital vital = stat as Vital;

                    Debug.Log(vital != null
                        ? string.Format("Stat {0}'s value is {1}/{2}", vital.Name, vital.CurrentValue, vital.Value)
                        : string.Format("Stat {0}'s value is {1}", stat.Name, stat.Value));
                }
            });
        }
Exemple #4
0
        private void Start()
        {
            _stats = new DefaultStats();

            var health = _stats.GetStat <Vital>(StatType.Health);

            health.AddModifier(new StatModifier(2, false, ModifierType.TotalValueAdd));
            health.OnCurrentValueChanged += OnStatValueChange;

            DisplayStatValues();

            health.CurrentValue -= 75;

            DisplayStatValues();
        }