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(); } }
public void EatBug(GameObject BugObject) { _coins.AddCoin(); Destroy(BugObject); _nothingWasEaten = false; if (BugsOnLvl.Length - _currentLvl == 9) { _movingUpObjects.NeedToMoveOnlyCharacter = true; } if (BugsOnLvl.Length - _currentLvl == 1) { _movingUpObjects.MovingUpAmount = 2f; } BugsOnLvl[_currentLvl]--; if (BugsOnLvl[_currentLvl] <= 0) { _currentLvl++; _movingUpObjects.MoveObjectsUp(); } if (BugsOnLvl.Length - _currentLvl == 0) { _bossModel.NeedToStartBossBattle = true; } _staminaSlider.IncreaseStaminaByNum(_eatingModel.EnergyBySingleBug); }