private void OnReady() { BackgroundScroll.RevertEach(ScrollRevertSpeed, null); DeleteEnemies(); ResetScore(); _mainMenu.SetActive(false); _playBtn.SetActive(false); _rePlayBtn.SetActive(false); _shadow.SetActive(true); _inGameScoreText.gameObject.SetActive(false); _player.gameObject.SetActive(true); _player.GetComponent <Animator>().SetTrigger(MoveStartTrigger); _gardenGnome.GetComponent <SpriteRenderer>().sortingOrder = ToutorialGuideSortOrder; _gardenGnome.GetComponent <Animator>().SetTrigger(TalkTrigger); _toutorial.SetActive(true); _gameTitle.gameObject.SetActive(false); _scoreboardText.gameObject.SetActive(false); _heart.SetActive(false); _heartText.gameObject.SetActive(false); _unknownItemView.SetActive(false); _intensiveItemView.SetActive(false); _speedUpPlayerView.SetActive(false); _noBombsItemView.SetActive(false); _extraPointsView.SetActive(false); _pointsMultyView.SetActive(false); _extraHeartsView.SetActive(false); }
private void OnEndGame() { _player.gameObject.SetActive(true); _player.GetComponent <Animator>().SetTrigger(MoveEndTrigger); BackgroundScroll.RevertEach(ScrollRevertSpeed, () => { _mainMenu.SetActive(true); _player.gameObject.SetActive(false); _playBtn.SetActive(false); _rePlayBtn.SetActive(true); }); DeleteEnemies(); ResetScore(); _shadow.SetActive(true); _inGameScoreText.gameObject.SetActive(false); //_player.SetActive(false); _gardenGnome.GetComponent <Animator>().SetTrigger(IdleTrigger); _gardenGnome.GetComponent <SpriteRenderer>().sortingOrder = DefaultGnomeSortOrder; _toutorial.SetActive(false); _gameTitle.gameObject.SetActive(true); _gameTitle.text = GameManager.GameOverText; _gameTitle.fontSize = GameOverFontSize; _gameTitle.color = GameOverFontColor; _scoreboardText.gameObject.SetActive(true); _scoreboardText.text = string.Format("{0} {1}{2}{3} {4}", GameManager.ScoreText, GameManager.Instance.Score, Environment.NewLine, GameManager.BestScoreText, GameManager.Instance.HighScore); _scoreboardText.color = GameManager.Instance.IsNewHighScore ? NewHighScoreFontColor: ScoreboardFontColor; _heart.SetActive(false); _heartText.gameObject.SetActive(false); _unknownItemView.SetActive(false); _intensiveItemView.SetActive(false); _speedUpPlayerView.SetActive(false); _noBombsItemView.SetActive(false); _extraPointsView.SetActive(false); _pointsMultyView.SetActive(false); _extraHeartsView.SetActive(false); }