Shegotwet/Assets/Scripts/UI/LobbyUI.cs

69 lines
2.0 KiB
C#
Raw Normal View History

using System.Collections;
2025-09-12 03:45:57 +00:00
using TMPro;
using UnityEngine;
public class LobbyUI : MonoBehaviourSingletonTemplate<LobbyUI>
{
2025-09-12 04:04:46 +00:00
[SerializeField] TextMeshProUGUI[] texts_money; // 0 앨범 개방 재화, 1 채팅 재화, 2 뽑기 재화
2025-09-12 03:45:57 +00:00
2025-09-12 12:48:21 +00:00
[Header("Popup UI")]
[SerializeField] AttandanceUI m_AttandanceUI;
2025-09-11 06:10:39 +00:00
[SerializeField] OptionUI m_OptionUI;
2025-09-11 06:23:15 +00:00
[SerializeField] ProfileUI m_ProfileUI;
public ToastUI m_ToastUI;
2025-09-12 04:10:11 +00:00
2025-09-12 12:48:21 +00:00
[Header("Center UI")]
[SerializeField] AlbumUI m_AlbumUI;
2025-09-12 04:10:11 +00:00
[SerializeField] GachaUI m_GachaUI;
2025-09-13 05:13:33 +00:00
[Header("Bot UI")]
[SerializeField] GameObject[] gos_homeBot; // 게임 버튼
2025-09-12 12:48:21 +00:00
[Header("Games")]
2025-09-12 19:39:24 +00:00
public Game_Lucky m_Game_Lucky;
2025-09-13 05:13:33 +00:00
[SerializeField] GameObject go_shop;
2025-09-12 12:48:21 +00:00
IEnumerator Start()
{
yield return null;
if (SaveMgr.Ins.CanGet_Attandance())
m_AttandanceUI.Set();
}
public void OnClick_Button(GameObject btn)
{
switch (btn.name)
{
case "btn_attendance": m_AttandanceUI.Set(); break;
2025-09-11 06:10:39 +00:00
case "btn_option": m_OptionUI.Set(); break;
2025-09-13 21:57:57 +00:00
case "btn_album": Go_Home(); m_AlbumUI.Set(); break;
case "btn_home": Go_Home(); break;
2025-09-12 04:10:11 +00:00
case "btn_gacha": m_GachaUI.Set(); break;
2025-09-13 05:13:33 +00:00
case "btn_shop":
2025-09-13 21:57:57 +00:00
Go_Home();
2025-09-13 05:13:33 +00:00
go_shop.SetActive(true);
DSUtil.InActivateGameObjects(gos_homeBot);
break;
}
}
2025-09-13 21:57:57 +00:00
void Go_Home()
{
m_AlbumUI.gameObject.SetActive(false);
m_GachaUI.gameObject.SetActive(false);
go_shop.SetActive(false);
DSUtil.ActivateGameObjects(gos_homeBot);
}
2025-09-11 06:23:15 +00:00
2025-09-12 03:45:57 +00:00
public void Set_Money()
{
2025-09-12 04:04:46 +00:00
texts_money[0].text = SaveMgr.Ins.Get_Money(eMoney.AlbumOpen).ToString();
texts_money[1].text = SaveMgr.Ins.Get_Money(eMoney.Chat).ToString();
texts_money[2].text = SaveMgr.Ins.Get_Money(eMoney.Gacha).ToString();
2025-09-12 03:45:57 +00:00
}
2025-09-11 06:23:15 +00:00
public void Show_Profile(int girlid)
{
m_ProfileUI.Set(girlid);
}
}