Beispiel #1
0
    public void CheckReward()
    {
        string rewardText = GameConfig.CheckFreeSkinFromMatchPlayed();

        if (!rewardText.Equals(""))
        {
            rewardtab.GetComponent <TabMovment>().SetTextInTab(rewardText);
            rewardtab.SetActive(true);
        }
    }
    private void OnEnable()
    {
        leaderboardButton.SetActive(!GameSceneManager.instance.noInternet);

        if (GameManager.instance.playerData.matchPlayed == 0)
        {
            GameManager.instance.AFTrackRichEvent("af_tutorial_completion");
        }

        string rewardText = GameConfig.CheckFreeSkinFromMatchPlayed();

        if (!rewardText.Equals(""))
        {
            rewardtab.GetComponent <TabMovment>().SetTextInTab(rewardText);
            rewardtab.SetActive(true);
        }

        GameManager.instance.AFTrackRichEvent("sendScore", null, (long)Mathf.Round(GameSceneManager.instance.scoreManager.scoreCount));

        LeaderboardController.instance.UpdateHighScore((long)Mathf.Round(GameSceneManager.instance.scoreManager.scoreCount));

        //topUpBanner.SetActive(!GameManager.instance.CheckGachaAvailability());
        gachaBanner.SetActive(GameManager.instance.CheckGachaAvailability());

        earnCoinContainer.SetActive(false);
        innerAdsBanner.SetActive(true);
        adsButton.SetActive(true);

        GameSceneManager.instance.currentAdsCoin = Random.Range(30, 100);
        GameManager.instance.playerData.matchPlayed++;
        GameConfig.CheckFreeSkin();
        GameManager.instance.playerData.SaveData();

        currentScore.text = ((long)Mathf.Round(GameSceneManager.instance.scoreManager.scoreCount)).ToString();
        hiScore.text      = LocalizedString.GetString("best") + " " + LeaderboardController.instance.playerHighScore.ToString();
        todayScore.text   = LocalizedString.GetString("today") + " " + LeaderboardController.instance.playerHighScoreDaily.ToString();
    }