public void RequestUnlockLevel(Level level) { if (!level.locked || !levelsIconsDict.ContainsKey(level)) return; LevelSelectorIcon icon = levelsIconsDict[level]; icon.SetButtonSprite(levelIconsScreen.levelUnlocked); level.locked = false; }
private void CompleteLevel(Level level) { level.completed = true; nDirkams += level.dirkams; dirkams.text = "Dirkams: " + nDirkams.ToString(); if (level.completeButton) level.completeButton.interactable = false; foreach(Level lv in level.levelsUnlocked) { RequestUnlockLevel(lv); } LevelSelectorIcon icon = levelsIconsDict[level]; icon.SetButtonSprite(levelIconsScreen.levelCompleted); if (CheckAllMandatoryCompleted()) { ToCompletitionScreen(); } else { BackToLevelSelection(); } }