Files
ichni_Official/Assets/Scripts/UI/SongSelection/DifficultySelectionContainer.cs

36 lines
1.1 KiB
C#
Raw Permalink Normal View History

2025-07-21 05:42:20 -04:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2025-08-11 14:04:06 -04:00
namespace Ichni.Menu
2025-07-21 05:42:20 -04:00
{
public class DifficultySelectionContainer : MonoBehaviour
{
public List<DifficultySelectionButton> buttons;
public DifficultySelectionButton selectedButton;
public void SetUp(List<DifficultyData> 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]);
}
2025-08-27 21:45:18 -04:00
SongSelectionRecord songSelectionRecord = MenuInformationRecorder.instance.GetRecordOfThisChapter();
if (songSelectionRecord.difficultyIndex >= difficultyCount)
2025-07-21 05:42:20 -04:00
{
2025-08-27 21:45:18 -04:00
songSelectionRecord.difficultyIndex = difficultyCount - 1;
2025-07-21 05:42:20 -04:00
}
2025-08-27 21:45:18 -04:00
buttons[songSelectionRecord.difficultyIndex].Select();
2025-07-21 05:42:20 -04:00
}
}
}