public bool CapacityRemove(float valueToRemove) { if (!CanUseCapacity) { return(false); } if (!(Capacity - valueToRemove >= Config.MinCapacity)) { return(false); } Capacity -= valueToRemove; OnAttributeCapacityChange?.Invoke(Capacity, Capacity + valueToRemove); return(true); }
public bool CapacityAdd(float valueToAdd) { if (!CanUseCapacity) { return(false); } if (!Config.AllowExceedCapacity && !(Capacity + valueToAdd <= Value)) { return(false); } Capacity += valueToAdd; OnAttributeCapacityChange?.Invoke(Capacity, Capacity - valueToAdd); return(true); }