예제 #1
0
    void OnLvlLoaded(Lvl _, int index)
    {
        numberOfLvlScore = 0;
        currentLvlIndex  = index;
        var highScore = currentLvlIndex >= allScores.scoreList.Count ? 10 : allScores.scoreList[currentLvlIndex];

        OnLoadScore.Invoke(currentLvlIndex, highScore);
        if (allScores.scoreList.Count >= currentLvlIndex + 1)
        {
            OnBestScoreLoaded.Invoke(allScores.scoreList[currentLvlIndex]);
        }
        else
        {
            OnBestScoreLoaded.Invoke(1000);
        }
    }
예제 #2
0
 void UpdateHighScore(bool isBot, bool scoreLimit)
 {
     if (!isBot && !scoreLimit)
     {
         if (allScores.scoreList.Count > currentLvlIndex)
         {
             if (allScores.scoreList[currentLvlIndex] > numberOfLvlScore)
             {
                 allScores.scoreList[currentLvlIndex] = numberOfLvlScore;
             }
         }
         else
         {
             allScores.scoreList.Add(numberOfLvlScore);
         }
         OnBestScoreLoaded.Invoke(allScores.scoreList[currentLvlIndex]);
         allScores.SaveScore();
     }
 }