Shegotwet/Assets/Scripts/UI/GachaUI.cs

41 lines
1.0 KiB
C#
Raw Normal View History

2025-09-12 05:23:34 +00:00
using System.Collections.Generic;
2025-09-12 04:10:11 +00:00
using UnityEngine;
2025-09-12 05:23:34 +00:00
using UnityEngine.UI;
2025-09-12 04:10:11 +00:00
2025-09-12 05:23:34 +00:00
public class GachaUI : uScrollViewMgr
2025-09-12 04:10:11 +00:00
{
2025-09-12 05:23:34 +00:00
public GameObject[] gos_grade;
public Slider slider_lucky;
2025-09-12 05:23:34 +00:00
List<(eMoney, int)> list_log = new List<(eMoney, int)>();
2025-09-12 04:10:11 +00:00
public void Set()
{
gameObject.SetActive(true);
2025-09-12 05:23:34 +00:00
DSUtil.InActivateGameObjects(gos_grade);
Set_UI();
}
void Set_UI()
{
slider_lucky.value = SaveMgr.Ins.Get_Money(eMoney.Lucky) / table_GlobalValue.Ins.Get_Float("LuckyPoint");
2025-09-12 05:23:34 +00:00
}
public void OnClick_Lucky()
{
2025-09-12 04:10:11 +00:00
}
2025-09-12 04:54:04 +00:00
public void OnClick_Gacha()
{
var gradedata = table_gacharateconfig.Ins.Get_RadomData();
2025-09-12 05:23:34 +00:00
DSUtil.InActivateGameObjects(gos_grade, gradedata.n_GachaGrade - 1);
2025-09-12 04:54:04 +00:00
var reward = table_gachareward.Ins.Get_Reward(gradedata.n_GachaGrade);
SaveMgr.Ins.Add_Money(reward.Item1, reward.Item2);
SaveMgr.Ins.Save();
2025-09-12 05:23:34 +00:00
list_log.Add(reward);
Set_ScrollView(list_log);
Set_Vertical_ScrollEnd(0);
Set_UI();
2025-09-12 04:54:04 +00:00
}
2025-09-12 04:10:11 +00:00
}