Beispiel #1
0
    public void EndGame()
    {
        gameIsOver = true;

        gameOverUI.gameObject.SetActive(true);
        scoreUI.gameObject.SetActive(false);

        if (PlayerStats.Score > PlayerPrefs.GetInt("best"))
        {
            PlayerPrefs.SetInt("best", PlayerStats.Score);
            PlayerPrefs.Save();

            gameOverUI.ShowBest();
        }

        PlayerPrefs.SetInt("Money", PlayerStats.Money);
        PlayerPrefs.Save();

        PlayerStats.ResetMultiplier();

        //voodoo
        GameAnalytics.NewProgressionEvent(GAProgressionStatus.Complete, "game", PlayerStats.Score);

        //me
        GameAnalytics.NewDesignEvent("factory", PlayerStats.BackgroundLevel);
        GameAnalytics.NewDesignEvent("income", PlayerStats.IncomeLevel);
        GameAnalytics.NewDesignEvent("level", PlayerStats.Level);
        GameAnalytics.NewDesignEvent("money", PlayerStats.Money);
        GameAnalytics.NewDesignEvent("best", PlayerStats.Best);
    }