备份CatanBuilding瘦身独立工程
This commit is contained in:
47
Assets/Scripts/UI/Setting/FishingNoticePopupPanel.cs
Normal file
47
Assets/Scripts/UI/Setting/FishingNoticePopupPanel.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user