Exemple #1
0
    void GameOver()
    {
        GetComponent <Rigidbody2D>().drag        = 9999; // Makes the ball unable to move
        GetComponent <Rigidbody2D>().isKinematic = true;
        PlayerPrefs.SetInt("Score", score);

        if (score > bestScore)
        {
            PlayerPrefs.SetInt("Best Score", score);
        }

        if (!usedRevived && credits > 25)
        {
            StartCoroutine(ReviveTimer(0f, 5f));
        }

        gameOverMenu.SetActive(true);
        gameOverMenu.GetComponent <GameOverScript>().StartGameOverSequence();
        Button pauseButton = GameObject.Find("PauseButton").GetComponent <Button>();

        pauseButton.interactable = false;
#if !UNITY_EDITOR
        PlayGamesScript.AddScordToLeaderboard(GPGSIds.leaderboard_leaderboard_for_golf_pads, score);
#endif
    }