Exemplo n.º 1
0
 public void SetAndSaveBestScore()
 {
     Debug.Log("Checking and setting best scores");
     for (int i = 0; i < scores.Count; i++)
     {
         if (!scores [i].isFloat)
         {
             if (Crypting.DecryptInt(scores [i].score) > Crypting.DecryptInt(bestScores [i].score))
             {
                 bestScores [i].score = scores [i].score;
                 if (scores[i].newBest != null)
                 {
                     scores [i].newBest.GetComponent <Blink> ().BlinkNewBest();
                 }
             }
         }
         else
         {
             if (Crypting.DecryptFloat(scores [i].score) > Crypting.DecryptFloat(bestScores [i].score))
             {
                 bestScores [i].score = scores [i].score;
                 if (scores[i].newBest != null)
                 {
                     scores [i].newBest.GetComponent <Blink> ().BlinkNewBest();
                 }
             }
         }
     }
     //OVDE TREBA PRVO DA SE POSALJU SKOROVI LOCAL DB-u i SERVER API-ju
     App.local.PlayerSave();
     //App.server.Save();
 }
Exemplo n.º 2
0
 public void ScoreMinus(float amount, string name)
 {
     for (int i = 0; i < scores.Count; i++)
     {
         if (scores[i].scoreName.CompareTo(name) == 0)
         {
             scores[i].score = Crypting.EncryptFloat(Crypting.DecryptFloat(scores[i].score) - amount);
             foreach (UILabel labela in scores[i].scoreLabels)
             {
                 labela.text = GetScore(scores[i].scoreName).ToString();
             }
         }
     }
 }
Exemplo n.º 3
0
 public float GetBestScore(string name)
 {
     for (int i = 0; i < bestScores.Count; i++)
     {
         if (bestScores[i].scoreName.CompareTo(name) == 0)
         {
             if (bestScores[i].isFloat)
             {
                 return(Crypting.DecryptFloat(bestScores[i].score));
             }
             else
             {
                 return((int)Crypting.DecryptFloat(bestScores[i].score));
             }
         }
     }
     return(-1);
 }