Exemplo n.º 1
0
    private void UpdateLevelInfo(MatchingLevel currentLevel, float fillAmount)
    {
        string levelDescriptionString = "Level " + currentLevel.LevelId + ": " + currentLevel.LevelName;

        if (!lastLevel)
        {
            levelDescription.text = levelDescriptionString;
        }

        if (lastLevel && currentLevel != lastLevel)
        {
            LeanTween.value(progressBar.gameObject, (float value, float ratio) =>
            {
                progressBar.fillAmount = value;
            }, progressBar.fillAmount, 1f, 0.5f)
            .setOnComplete(() => {
                levelDescription.text = levelDescriptionString;
                AudioManager.Instance.PlaySound("LevelUp");
                LeanTween.value(progressBar.gameObject, (float value, float ratio) =>
                {
                    progressBar.fillAmount = value;
                }, 0f, fillAmount, 0.5f).setDelay(0.2f);
            });
        }
        else
        {
            LeanTween.value(progressBar.gameObject, (float value, float ratio) =>
            {
                progressBar.fillAmount = value;
            }, progressBar.fillAmount, fillAmount, 0.5f);
        }
        lastLevel = currentLevel;
    }
Exemplo n.º 2
0
 void OnLevelProgressChanged(MatchingLevel level, int currentProgress, int scoreToNextLevel)
 {
     if (onLevelProgressChanged != null)
     {
         onLevelProgressChanged(level, currentProgress, scoreToNextLevel);
     }
 }
Exemplo n.º 3
0
 private MatchingLevel GetNextLevel(int levelId)
 {
     Debug.Log("LEVEL " + levelId);
     scoreToNextLevel = scoresToNextLevel[levelId];
     CurrentLevel     = GetLevel(levelId);
     currentLevelId   = levelId;
     return(CurrentLevel);
 }
Exemplo n.º 4
0
 public static bool IsRegularExpressionProvided(this IRepresentRegularExpression source, MatchingLevel minimalMatchingLevel)
 {
     return(source.RegularExpressionMatchingLevel >= minimalMatchingLevel);
 }
Exemplo n.º 5
0
 private void OnLevelProgressChanged(MatchingLevel currentLevel, int currentLevelProgress, int scoreToNextLevel)
 {
     UpdateLevelInfo(currentLevel, (float)currentLevelProgress / (float)scoreToNextLevel);
 }