public void StopGame() { gameState.IsGameStopped = true; if (gameState.IsGameInFlexMode) { flexMode.StopFlexingAfterDeath(); } spawningObjects.StopSpawnCoroutines(); uI.gameOverInterface.SetActive(true); uI.scoreMenu.SetActive(false); if (gameState.Score > scoreManager.CurrentBestScoreForNextImage()) { uI.gameOverInterface.transform.GetChild(2).GetChild(0).gameObject.SetActive(true); } drawNumber.DrawScore(gameState.Score, uI.gameOverScoreMenu, sprites.smallDigitsDict, sprites.DefaultSpritesArray); drawNumber.DrawScore(scoreManager.CurrentBestScoreForDrawing(), uI.gameOverBestScoreMenu, sprites.smallDigitsDict, sprites.DefaultSpritesArray); serializationManager.SaveAmountOfMoney(gameState.AmountOfMoney); components.audioPlayer.PlaySound( components.audioPlayer.deathSoundArray[gameState.SkinID], components.audioPlayer.inGameSoundAudioSource, 1, false ); }
private void ChangeCoroutinesSpeed(float first, float second, float third, float fourth) { spawningObjects.StopSpawnCoroutines(); spawningObjects.StartSpawnCoroutines(first, second, third, fourth); }