public void Update(Transform transform) { var leftOverHoney = Mathf.Min(_beeHoneyData.AvailableCount, _beeHoneyData.Rate * Time.deltaTime); _hive.AddHoney(leftOverHoney); _beeHoneyData.AddHoney(-leftOverHoney); if (_beeHoneyData.AvailableCount <= 0) { OnEnd.Invoke(); } }
public void Update(Transform transform) { var leftOverHoney = Mathf.Min(Mathf.Min(_flower.Honey, _beeHoneyData.Limit - _beeHoneyData.AvailableCount), _beeHoneyData.Rate * Time.deltaTime); _beeHoneyData.AddHoney(leftOverHoney); if (_flower.Honey <= 0 || _beeHoneyData.IsFullHoney) { OnEnd.Invoke(); } else { _flower.Honey -= leftOverHoney; } }