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(); } } } public GameObject[] noticeList; public Action OnOkButtonClick; void ShowNotice(NoticeType type) { for (int i = 0; i < noticeList.Length; i++) { noticeList[i].SetActive(i == (int)type); } } }