private void Update()
 {
     if (_inputController.InputStarted && !_eatingModel.IsBiting && _eatingModel.СanBiteAgain && _eatingModel.СanBiteAtAll)
     {
         _nothingWasEaten          = true;
         _eatingModel.IsBiting     = true;
         _eatingModel.СanBiteAgain = false;
         _animatorsModel.MakeBiteAnimation();
         _bitingEnded = false;
         if (_bossModel.IsBossFightNow)
         {
             if (_eatingModel.SpeedOfBiting != _eatingModel.SpeedOfBitingForBossBattle)
             {
                 _eatingModel.SpeedOfBiting = _eatingModel.SpeedOfBitingForBossBattle;
             }
             _soundController.PlayEatSomethingSound();
             _bossModel.BossGetDamage();
             _particlesController.PlayBossParticles();
             _coins.AddCoin();
         }
     }
     if (!_inputController.InputStarted && !_eatingModel.СanBiteAgain)
     {
         _eatingModel.СanBiteAgain = true;
     }
     if (_eatingModel.BiteWasMade && !_bitingEnded)
     {
         ReduceStamina();
     }
 }
Пример #2
0
 private void FixedUpdate()
 {
     if (_inputController.InputStarted && !_eatingModel.IsBiting && _eatingModel.СanBiteAgain && _eatingModel.СanBiteAtAll)
     {
         _nothingWasEaten          = true;
         _eatingModel.IsBiting     = true;
         _eatingModel.СanBiteAgain = false;
         _animatorsModel.MakeBiteAnimation();
         _bitingEnded = false;
         if (_bossModel.IsBossFightNow)
         {
             _bossModel.BossGetDamage();
             _particlesController.PlayBossParticles();
         }
     }
     if (!_inputController.InputStarted && !_eatingModel.СanBiteAgain)
     {
         _eatingModel.СanBiteAgain = true;
     }
     if (_eatingModel.IsBiting)
     {
         _eatingModel.MakeBite();
     }
     if (_eatingModel.BiteWasMade && !_bitingEnded)
     {
         ReduceStamina();
     }
 }