36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.Menu
|
|
{
|
|
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]);
|
|
}
|
|
|
|
SongSelectionRecord songSelectionRecord = MenuInformationRecorder.instance.GetRecordOfThisChapter();
|
|
|
|
if (songSelectionRecord.difficultyIndex >= difficultyCount)
|
|
{
|
|
songSelectionRecord.difficultyIndex = difficultyCount - 1;
|
|
}
|
|
|
|
buttons[songSelectionRecord.difficultyIndex].Select();
|
|
}
|
|
}
|
|
} |