35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.Serialization;
|
||
|
|
|
||
|
|
namespace Ichni.Menu.UI
|
||
|
|
{
|
||
|
|
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]);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (MenuManager.instance.songSelectionUIPage.currentSelectedDifficultyIndex >= difficultyCount)
|
||
|
|
{
|
||
|
|
MenuManager.instance.songSelectionUIPage.currentSelectedDifficultyIndex = difficultyCount - 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
buttons[MenuManager.instance.songSelectionUIPage.currentSelectedDifficultyIndex].Select();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|