Пример #1
0
        void CollectHarvest(HarvestResult harvestResult)
        {
            if (!harvestResult.success)
            {
                if (_harvesting)
                {
                    _harvesting        = false;
                    _behaviour.canMove = true;
                }
                _onHarvestEnd(false);
                return;
            }

            if (_inventory)
            {
                if (_harvesting)
                {
                    _harvesting        = false;
                    _behaviour.canMove = true;
                }

                CameraSound.PlaySoundAtCameraPosition(harvestSound, 0.5f);
                _inventory.AddItem(harvestResult.harvest);
                _onHarvestEnd(true);
            }
            else
            {
                _onHarvestEnd(false);
            }
        }
Пример #2
0
 public void ConsumeFuel(int amount)
 {
     if (_inventory.SubtractFuel(amount))
     {
         CameraSound.PlaySoundAtCameraPosition(eatSound, 0.3f);
         _fuelTimer.AddTime(amount * timerPerFuel);
     }
 }
Пример #3
0
 void ShowHappy()
 {
     if (!_showingEmotion)
     {
         _showingEmotion = true;
         CameraSound.PlaySoundAtCameraPosition(happySound, 0.5f);
         emotionAnimator.SetTrigger(IsHappy);
         StartCoroutine(FinishShowingEmotion());
     }
 }