Example #1
0
 public virtual void LoadLevel(string levelName)
 {
     if (StageManager.isLevelUnlocked(levelName))
     {
         PlayerPrefs.SetString("NextLevelId", nextLevelId);
         SceneManager.LoadScene(levelName);
     }
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     for (int i = 0; i < buttons.Length; i++)
     {
         if (buttons[i].setToUnlock)
         {
             StageManager.UnlockLevel(buttons[i]);
         }
         if (StageManager.isLevelUnlocked(buttons[i]))
         {
             buttons[i].button.interactable = true;
         }
         else
         {
             buttons[i].button.interactable = false;
         }
         //buttons[i].button.onClick.AddListener(() => { LoadLevel(buttons[i]); });
     }
 }
Example #3
0
 // Use this for initialization
 void Start()
 {
     unlockBtn.onClick.AddListener(() => { StageManager.UnlockNextLevel(); });
     lockBtn.onClick.AddListener(() => { StageManager.LockLevel(PlayerPrefs.GetString("NextLevelId")); });
 }