コード例 #1
0
    public void enableGameOverScreen()
    {
        // enable if u want to test ads
        if (PlayerPrefs.GetInt("AdsEnabled", 0) == 0)
        {
            if (Random.Range(1, 10) <= 3)
            {
                adControl.ShowInterstitialAd();
            }
        }
        gameOverScreen.transform.DOLocalMove(gameOverScreenpos2, 0.3f);
        Darken(true);
        int bonesCollected = pc.getBonesCollected();

        gameOverStats.transform.Find("BonesCollected").GetComponent <TextMeshProUGUI>().text = "<color=#616161>Bones collected: " + bonesCollected + "</color>";
        int killCount = pc.getKillCount();

        gameOverStats.transform.Find("KillCount").GetComponent <TextMeshProUGUI>().text = "<color=#44212F>Enemies defeated: " + killCount + "</color>";
        int accuracy = pc.getAccuracy();

        gameOverStats.transform.Find("Accuracy").GetComponent <TextMeshProUGUI>().text = "<color=#3A5339>Bone accuracy: " + accuracy + "%</color>";
        gameOverStats.transform.Find("Score").GetComponent <TextMeshProUGUI>().text    = "<color=#323866>Score: " + score + "</color>";
        socialControl.ReportScore(score);
        if (score > PlayerPrefs.GetInt("Highscore", 0))
        {
            PlayerPrefs.SetInt("Highscore", highScore);
        }
    }