private void levelEnd() { endType = getEndType(); UnityEngine.Debug.Log(endType); if (game.mode != GameMode.ADVENTURE) { SoundManager.instance.GameWin(); } if (game.mode == GameMode.NORMAL) { if (levelToOpen == -1) { PlayerPrefsManager.SetLevel(PlayerPrefsManager.GetLevel() + 1); PlayerPrefsManager.SetBrilliance(PlayerPrefsManager.GetBrilliance() + 1); PlayerPrefsManager.ResetProHint(); FirebaseController.SendLevelLog(); } else { levelToOpen++; } } Movements.instance.executeWithDelay((Movements.Execute)GameAnimController.instance.niceTexts, 0.7f); if (onGameEnd != null) { onGameEnd(game); } }
private static void endGame() { if (!running) { return; } if (BoardController.levelToOpen == -1) { GameAnimController.instance.onExtraCoinFull(); } GameAnimController.instance.extrawords.SetActive(value: false); Movements.instance.executeWithDelay((Movements.Execute)GameAnimController.instance.endGame, 1f); if (BoardController.levelToOpen == -1 && !BoardController.daily) { PlayerPrefsManager.SetBrilliance(PlayerPrefsManager.GetBrilliance() + 1); } BoardController.instance.logLevelEnd(); GameAnimController.instance.extra = true; GameAnimController.instance.toggleExtraWords(); TutorialController.instance.closeAll(); SoundManager.instance.GameWin(); if (BoardController.daily) { UnityEngine.Debug.Log("daily end"); } else if (BoardController.levelToOpen != -1) { BoardController.levelToOpen++; } else { int num = PlayerPrefsManager.GetLevel(); PlayerPrefsManager.SetLatestLevel(PlayerPrefsManager.GetLevel()); PlayerPrefsManager.SetLevel(PlayerPrefsManager.GetLevel() + 1); FirebaseController.SendLevelLog(); if (BoardController.levelToOpen == -1) { PlayerPrefsManager.ResetProHint(); } RequestManager.instance.LogRequest(); } running = false; }