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

42 lines
1.2 KiB
C#
Raw Normal View History

2025-06-14 14:42:49 -04:00
using System;
2025-06-03 02:42:28 -04:00
using System.Collections;
using System.Collections.Generic;
2025-06-14 14:42:49 -04:00
using Ichni.Menu;
using Ichni.Menu.UI;
using Ichni.UI;
2025-06-03 02:42:28 -04:00
using UnityEngine;
2025-06-06 10:14:55 -04:00
namespace Ichni.UI
2025-06-03 02:42:28 -04:00
{
2025-06-06 10:14:55 -04:00
public class SongSelectionUIPage : UIPageBase
2025-06-03 02:42:28 -04:00
{
2025-06-14 14:42:49 -04:00
public GameObject songSelectionTabPrefab;
public RectTransform songSelectionTabContainer;
public List<SongSelectionTabUI> songSelectionTabs;
private void Start()
{
GenerateSongTabs();
}
public void GenerateSongTabs()
{
string chapter = ChapterSelectionManager.instance.currentChapter;
ChapterSelectionUnit chapterUnit = ChapterSelectionManager.instance.chapters.Find(c => c.chapterIndex == chapter);
foreach (SongItemData song in chapterUnit.songs)
{
SongSelectionTabUI tab = Instantiate(songSelectionTabPrefab, songSelectionTabContainer).GetComponent<SongSelectionTabUI>();
tab.SetUpTab(song);
}
}
2025-06-03 02:42:28 -04:00
2025-06-14 14:42:49 -04:00
private void ClearTabs()
{
foreach (SongSelectionTabUI tab in songSelectionTabs)
{
Destroy(tab.gameObject);
}
songSelectionTabs.Clear();
}
2025-06-03 02:42:28 -04:00
}
}