1
This commit is contained in:
37
Assets/Scripts/UI/ChapterSelection/ChapterSelectionUI.cs
Normal file
37
Assets/Scripts/UI/ChapterSelection/ChapterSelectionUI.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Menu;
|
||||
using Ichni.Story;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.UI
|
||||
{
|
||||
public class ChapterSelectionUI : MonoBehaviour
|
||||
{
|
||||
public RectTransform content;
|
||||
public TMP_Text title;
|
||||
public TMP_Text subtitle;
|
||||
public Image avatar;
|
||||
public Image border;
|
||||
public Button area;
|
||||
|
||||
public void Initialize(ChapterSelectionUnit chapter)
|
||||
{
|
||||
title.text = chapter.chapterName;
|
||||
title.color = chapter.themeColor;
|
||||
subtitle.text = chapter.chapterSubtitle;
|
||||
subtitle.color = chapter.themeColor;
|
||||
|
||||
border.color = chapter.themeColor;
|
||||
avatar.sprite = chapter.avatar;
|
||||
|
||||
area.onClick.AddListener(() =>
|
||||
{
|
||||
ChapterSelectionManager.instance.chapterSelectionUIPage.FadeOut();
|
||||
StoryManager.instance.storyUIPage.FadeIn();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a483faf242f8c4f449b809db70741cf2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/Scripts/UI/ChapterSelection/ChapterSelectionUIPage.cs
Normal file
22
Assets/Scripts/UI/ChapterSelection/ChapterSelectionUIPage.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.UI
|
||||
{
|
||||
public class ChapterSelectionUIPage : UIPageBase
|
||||
{
|
||||
public RectTransform chapterContainer;
|
||||
|
||||
public GameObject chapterSelectionUIPrefab;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
foreach (var chapter in ChapterSelectionManager.instance.chapters)
|
||||
{
|
||||
ChapterSelectionUI item = Instantiate(chapterSelectionUIPrefab, chapterContainer).GetComponent<ChapterSelectionUI>();
|
||||
item.Initialize(chapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3adff9bbefe437245af8b1d1c9bf7e56
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user