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