StartMenu!
This commit is contained in:
36
Assets/Scripts/StartMenu/ThemeBundleSelector.cs
Normal file
36
Assets/Scripts/StartMenu/ThemeBundleSelector.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Ichni.StartMenu
|
||||
{
|
||||
public class ThemeBundleSelector : MonoBehaviour
|
||||
{
|
||||
public GameObject themeBundleTab;
|
||||
public RectTransform listTransform;
|
||||
public List<ThemeBundleTab> themeBundleTabs;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
SetUpList();
|
||||
}
|
||||
|
||||
private void SetUpList()
|
||||
{
|
||||
themeBundleTabs = new List<ThemeBundleTab>();
|
||||
foreach (var bundle in ThemeBundleManager.instance.themeBundleAbstractList)
|
||||
{
|
||||
ThemeBundleTab tab = Instantiate(themeBundleTab, listTransform).GetComponent<ThemeBundleTab>();
|
||||
tab.SetUpTab(bundle);
|
||||
themeBundleTabs.Add(tab);
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> GetSelectedThemeBundleList()
|
||||
{
|
||||
return (from tab in themeBundleTabs where tab.toggle.isOn select tab.connectedThemeBundle.fileName).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user