private void SaveBestScoreAndEditLevelCompletedPanel(string selectedGameMode)
    {
        levelCompletedScoreText.text = currentScore.ToString();
        int bestScore;

        if (selectedGameMode == "Zamana Karşı")
        {
            bestScore = int.Parse(EncryptionController.Decrypt(PlayerPrefs.GetString("bestScoreOfAgainstTime")));
        }
        else
        {
            bestScore = int.Parse(EncryptionController.Decrypt(PlayerPrefs.GetString("bestScoreOfNormal")));
        }
        if (currentScore > bestScore)
        {
            recordOldAreaForLevelCompletedArea.SetActive(false);
            recordNewAreaForLevelCompletedArea.SetActive(true);
            if (selectedGameMode == "Zamana Karşı")
            {
                PlayerPrefs.SetString("bestScoreOfAgainstTime", EncryptionController.Encrypt(currentScore.ToString()));
                if (EncryptionController.Decrypt(PlayerPrefs.GetString("removeAdsPurchased")) == "No")
                {
                    StartCoroutine(AdsAdMobController.InstanceAdsAdMobController.LoadInterstitialAd());
                } // Show InterstitialAd
                PlayServicesController.AddScoreToLeaderboard(GPGSIds.leaderboard_lider_tablosu__zamana_kar, currentScore);
            }
            else
            {
                PlayerPrefs.SetString("bestScoreOfNormal", EncryptionController.Encrypt(currentScore.ToString()));
                if (EncryptionController.Decrypt(PlayerPrefs.GetString("removeAdsPurchased")) == "No")
                {
                    StartCoroutine(AdsAdMobController.InstanceAdsAdMobController.LoadInterstitialAd());
                } // Show InterstitialAd
                PlayServicesController.AddScoreToLeaderboard(GPGSIds.leaderboard_lider_tablosu__normal_mod, currentScore);
            }
        }
        else
        {
            recordOldAreaForLevelCompletedArea.SetActive(true);
            recordNewAreaForLevelCompletedArea.SetActive(false);
            recordOldAreaForLevelCompletedArea.GetComponent <Text>().text = "Rekorunuz : " + bestScore.ToString();
        }
    }
Beispiel #2
0
        private void encryptButton_Click(object sender, EventArgs e)
        {
            //TODO: Check

            controller.Key             = keyBox.Text;
            controller.SourcePath      = sourceBox.Text;
            controller.DestinationPath = destinationBox.Text;

            if (controller.Encrypt())
            {
                MessageBox.Show("Done!", "Success",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Fail!", "Fail",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }