Problem is not reproducible or outdated
Level Menu Lock and Unlock doesn't work.
I was doing this tutorial about how to lock and unlock levels, the script worked to unlock the second level but since then, it hasn't unlocked any other levels. Is there a way to lock levels and unlock them correctly. I am using Unity 5.4.2f2. Here is the script i used:
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;
public class LevelSelection : MonoBehaviour { public Button[] lvlButtons;
// Start is called before the first frame update void Start() { int levelAt = PlayerPrefs.GetInt("levelAt", 3); for (int i = 0; i < lvlButtons.Length; i++) { if (i + 2 > levelAt) lvlButtons[i].interactable = false; } }
Follow this Question
Related Questions
how do i keep object destroyed after reloding scene ?? 0 Answers
Google Cloud Save (Not saving) 1 Answer
Playerprefs not saving on Android but saving in unity run editor 2 Answers
Application.persistentDataPath+"/playerinfo.dat" not saving in ipad but working in editor 0 Answers
Saving Instantiated objects,Saving Instantiated objects 0 Answers