public void Win()
    {
        if (!isOver)
        {
            isOver = true;
            gameUIHelper.Win();

            Camera.main.GetComponent <GameCameraController> ().Win();
            int currentLevel = PlayerPrefsManager.GetCurrentLevel();
            highscores.SaveHighScoreAtLevel(currentLevel, gameTime.GetTime());
            float bestTime = highscores.LoadHighscoreAtLevel(currentLevel);
            gameTime.ShowHighScore(bestTime);


            long theTimeInLong = System.Convert.ToInt64(gameTime.GetTime() * 1000);
            googleGame.PostScoreToLeaderboard(currentLevel, theTimeInLong);


            bool beatStarTime = gameTime.EndTimerAndDidBeatStarTime();
            if (beatStarTime)
            {
                levelHandler.UpdateArray(currentLevel, LevelHandlerC.LevelState.DONE_STAR);
            }
            else
            {
                levelHandler.UpdateArray(currentLevel, LevelHandlerC.LevelState.DONE);
            }
        }
    }
Esempio n. 2
0
    public void LoadTime()
    {
        float time = highscores.LoadHighscoreAtLevel(saveLevel);

        singleLevelText.text = saveLevel + ".\t" + time;
    }