示例#1
0
        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();
            }
        }
示例#2
0
        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;
            }
        }