Menu基本完成
This commit is contained in:
@@ -1,11 +1,42 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Menu;
|
||||
using Ichni.Menu.UI;
|
||||
using Ichni.UI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.UI
|
||||
{
|
||||
public class SongSelectionUIPage : UIPageBase
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearTabs()
|
||||
{
|
||||
foreach (SongSelectionTabUI tab in songSelectionTabs)
|
||||
{
|
||||
Destroy(tab.gameObject);
|
||||
}
|
||||
songSelectionTabs.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user