Files
MinFt/Client/Assets/Scripts/UI/Setting/FishingNoticePopupPanel.cs
2026-04-27 12:07:32 +08:00

48 lines
1.0 KiB
C#

using System;
using GameCore;
using UnityEngine;
public class FishingNoticePopupPanel : MonoBehaviour
{
public enum NoticeType
{
RECONNECTED,
UPDATE,
MAINTENANCE,
}
static FishingNoticePopupPanel _instance;
public FishingNoticePopupPanel Show(NoticeType type = NoticeType.RECONNECTED)
{
ShowInit();
_instance.transform.SetAsLastSibling();
_instance.ShowNotice(type);
return _instance;
}
private static async void ShowInit()
{
if (_instance == null)
{
GameObject loading = await UIManager.Instance.GetUIAsync(UITypes.FishingNoticePopupPanel);
if (loading != null)
{
_instance = loading.GetComponent<FishingNoticePopupPanel>();
}
}
}
public GameObject[] noticeList;
public Action OnOkButtonClick;
void ShowNotice(NoticeType type)
{
for (int i = 0; i < noticeList.Length; i++)
{
noticeList[i].SetActive(i == (int)type);
}
}
}