Files
ichni_Official/Assets/Scripts/UI/ChapterSelection/ChapterSelectionUIPage.cs
SoulliesOfficial 6aa498f6be
2025-08-11 14:04:06 -04:00

36 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Ichni.UI
{
public class ChapterSelectionUIPage : UIPageBase
{
public RectTransform chapterContainer;
public HorizontalLayoutGroup containerLayoutGroup;
public Button settingsButton;
public GameObject chapterSelectionUIPrefab;
protected override void Awake()
{
base.Awake();
settingsButton.onClick.AddListener(() =>
{
FadeOut();
MenuManager.instance.settingsUIPage.FadeIn();
});
}
private void Start()
{
foreach (var chapter in ChapterSelectionManager.instance.chapters)
{
ChapterSelectionUI item = Instantiate(chapterSelectionUIPrefab, chapterContainer).GetComponent<ChapterSelectionUI>();
item.Initialize(chapter);
item.chapterName = chapter.chapterName;
}
}
}
}