Пример #1
0
 /// <summary>
 /// Creates new instance of a timed stat modifier using the timed modifier info scriptable object
 /// </summary>
 public TimedStatModifier(TimedModifierInfoSO info)
 {
     name                   = info.name;
     time                   = info.time;
     value                  = info.Value;
     increase               = info.Increase;
     modifiesCurrent        = info.ModifiesCurrent;
     modifiesCurrentWithMax = info.ModifiesCurrentWithMax;
     canStack               = info.CanStack;
 }
Пример #2
0
        /// <summary>Adds a timed modifier to the stat system based on given info. time defaults to 0</summary>
        public TimedStatModifier AddTimedModifier(TimedModifierInfoSO info)
        {
            if (info == null)
            {
                throw new InvalidOperationException("Timed modifier Info was null");
            }

            TimedStatModifier modifier = new TimedStatModifier(info);

            InsertModifierInSystem(modifier);
            return(modifier);
        }