Ejemplo n.º 1
0
    private static void CompleteLevelInternal(int number, int starsCount)
    {
        if (IsLevelLocked(number))
        {
            Debug.Log(string.Format("Can't complete locked level {0}.", number));
        }
        else if (starsCount < 1 || starsCount > 3)
        {
            Debug.Log(string.Format("Can't complete level {0}. Invalid stars count {1}.", number, starsCount));
        }
        else
        {
            int curStarsCount = _mapProgressManager.LoadLevelStarsCount(number);
            int maxStarsCount = Mathf.Max(curStarsCount, starsCount);
            _mapProgressManager.SaveLevelStarsCount(number, maxStarsCount);

            if (_instance != null)
            {
                _instance.UpdateMapLevels();
            }
        }
    }