示例#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;
    }
示例#2
0
 void OnLevelProgressChanged(MatchingLevel level, int currentProgress, int scoreToNextLevel)
 {
     if (onLevelProgressChanged != null)
     {
         onLevelProgressChanged(level, currentProgress, scoreToNextLevel);
     }
 }
示例#3
0
 private MatchingLevel GetNextLevel(int levelId)
 {
     Debug.Log("LEVEL " + levelId);
     scoreToNextLevel = scoresToNextLevel[levelId];
     CurrentLevel     = GetLevel(levelId);
     currentLevelId   = levelId;
     return(CurrentLevel);
 }
示例#4
0
 public static bool IsRegularExpressionProvided(this IRepresentRegularExpression source, MatchingLevel minimalMatchingLevel)
 {
     return(source.RegularExpressionMatchingLevel >= minimalMatchingLevel);
 }
示例#5
0
 private void OnLevelProgressChanged(MatchingLevel currentLevel, int currentLevelProgress, int scoreToNextLevel)
 {
     UpdateLevelInfo(currentLevel, (float)currentLevelProgress / (float)scoreToNextLevel);
 }