Beispiel #1
0
        public void SetValue(T value)
        {
            if (_value != null && _value.Equals(value))
            {
                return;
            }
            _value = value;

            var tVal = Transform(value);

            if (_tValue != null && _tValue.Equals(tVal))
            {
                return;
            }
            _tValue = tVal;

            // hacky fix to xp
            if (_owner is Player && _type == StatsType.Experience)
            {
                _owner.InvokeStatChange(_type, (int)(object)tVal - Player.GetLevelExp((_owner as Player).Level), _updateSelfOnly);
            }
            else
            {
                _owner.InvokeStatChange(_type, tVal, _updateSelfOnly);
            }
        }