using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Ichni.Menu { public class DifficultySelectionContainer : MonoBehaviour { public List buttons; public DifficultySelectionButton selectedButton; public void SetUp(List difficulties) { int difficultyCount = difficulties.Count; for (var i = 0; i < buttons.Count; i++) { buttons[i].gameObject.SetActive(i < difficultyCount); } for (int i = 0; i < difficultyCount; i++) { buttons[i].SetUp(difficulties[i]); } SongSelectionRecord songSelectionRecord = MenuInformationRecorder.instance.GetRecordOfThisChapter(); if (songSelectionRecord.difficultyIndex >= difficultyCount) { songSelectionRecord.difficultyIndex = difficultyCount - 1; } buttons[songSelectionRecord.difficultyIndex].Select(); } } }