Files
M-Gameton-06/Gameton-06/Assets/Gameton/Scripts/UI/GuideUI.cs
2025-03-03 16:14:52 +09:00

48 lines
970 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TON
{
public class GuideUI : UIBase
{
[SerializeField] private List<GameObject> guideList = new List<GameObject>();
private int index = 0;
private void OnEnable()
{
index = 0;
ShowGuideObject();
}
private void OnDisable()
{
guideList.ForEach(guide => guide.SetActive(false));
}
private void ShowGuideObject()
{
if (index > 0)
{
guideList[index - 1].SetActive(false);
}
guideList[index].SetActive(true);
}
public void HandleClickScreen()
{
if (index == guideList.Count)
{
UIManager.Hide<GuideUI>(UIList.GuideUI);
return;
}
index++;
ShowGuideObject();
}
}
}