LazyBot/Assets/Scripts/Entity/EntityData.cs
/// <summary>
/// Changes value to the passed value.
/// </summary>
/// <param name="value">Change value.</param>
/// <param name="asPossible">Change value on maximum allowable value.</param>
/// <returns>Is value was successful changed.</returns>
Changes value to the passed value.
Changes value to the passed value .
public virtual bool Change(float value, bool asPossible = false)
        {
            if (_isUnlimited) return true;
            else if ((_isLock) ||
                ((!asPossible) && (!IsChangable(value)))) return false;
            _value += value;
            if (_value > _valueMax) _value = _valueMax;
            else if (_value < _valueMin) _value = _valueMin;
            return true;
        }
public virtual bool Change ( float value , bool asPossible = false ) { if ( _isUnlimited ) return true ; else if ( ( _isLock ) || ( ( ! asPossible ) && ( ! IsChangable ( value ) ) ) ) return false ; _value += value ; if ( _value > _valueMax ) _value = _valueMax ; else if ( _value < _valueMin ) _value = _valueMin ; return true ; }
Changes value to the passed value.
Changes value to the passed value .
None
value
float
None
asPossible
bool
Change value on maximum allowable value.
Change value on maximum allowable value .