using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [Serializable] public class LevelButtonStates { public GameObject Locked; public GameObject Unlocked; public GameObject Completed; } public class LevelSelectionScreen : MonoBehaviour { public List levelButtonStatesList; public void LockLevel(int levelIndex) { levelButtonStatesList[levelIndex].Completed.SetActive(false); levelButtonStatesList[levelIndex].Unlocked.SetActive(false); levelButtonStatesList[levelIndex].Locked.SetActive(true); } public void UnlockLevel(int levelIndex) { levelButtonStatesList[levelIndex].Completed.SetActive(false); levelButtonStatesList[levelIndex].Unlocked.SetActive(true); levelButtonStatesList[levelIndex].Locked.SetActive(false); } public void LevelCompleted(int levelIndex) { levelButtonStatesList[levelIndex].Completed.SetActive(true); levelButtonStatesList[levelIndex].Unlocked.SetActive(false); levelButtonStatesList[levelIndex].Locked.SetActive(false); } }