AxibugEmuOnline/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OverlayUI/OverlayManager.cs

44 lines
1.2 KiB
C#
Raw Normal View History

using AxibugEmuOnline.Client.ClientCore;
2024-12-11 21:21:27 +08:00
using System;
using System.Collections.Generic;
using UnityEngine;
namespace AxibugEmuOnline.Client
{
public class OverlayManager : MonoBehaviour
{
static OverlayManager s_ins;
2024-12-11 22:45:16 +08:00
[SerializeField] InputUI m_InputUI;
[SerializeField] OptionUI m_OptionUI;
[SerializeField] PopTipsUI m_popTipsUI;
2024-12-11 21:21:27 +08:00
private void Awake()
{
s_ins = this;
m_InputUI.gameObject.SetActive(false);
}
public static void Input(Action<string> callback, string placeHolder, string defaultText)
2024-12-11 21:21:27 +08:00
{
#if UNITY_PSP2
App.sonyVitaCommonDialog.ShowPSVitaIME(callback, placeHolder, defaultText);
#else
s_ins.m_InputUI.Show(new ValueTuple<Action<string>, string, string>(callback, placeHolder, defaultText));
#endif
2024-12-11 21:21:27 +08:00
}
2024-12-11 22:45:16 +08:00
public static void PopSideBar<T>(List<T> menus, int defaultIndex = 0, Action onClose = null) where T : OptionMenu
2024-12-11 21:21:27 +08:00
{
s_ins.m_OptionUI.Pop(menus, defaultIndex, onClose);
}
2024-12-11 22:45:16 +08:00
public static void PopTip(string msg)
2024-12-11 21:21:27 +08:00
{
2024-12-11 22:45:16 +08:00
s_ins.m_popTipsUI.Pop(msg);
2024-12-11 21:21:27 +08:00
}
}
}