This commit is contained in:
2026-08-01 15:58:39 +08:00
parent effe4e9692
commit 0195686408
2 changed files with 15 additions and 16 deletions
+4 -2
View File
@@ -249,22 +249,24 @@ public class UIManager : MonoSingleton<UIManager>
}
/// <summary>
/// 显示提示窗口(随时访问)。不自动关闭,需手动点确认/关闭按钮。
/// 返回 TiShi 实例,调用方可持有引用判断弹窗是否仍存在(已被销毁时 == null 为 true)。
/// </summary>
/// <param name="text">提示内容</param>
/// <param name="onConfirmAction">点击确认按钮时的回调(可选),关闭按钮不触发</param>
/// <param name="showClose">是否显示关闭按钮(默认 true,部分提示只能点确认)</param>
public void ShowTiShi(string text, Action onConfirmAction = null, bool showClose = true)
public TiShi ShowTiShi(string text, Action onConfirmAction = null, bool showClose = true)
{
if (TiShiParefab == null)
{
Debug.LogWarning("TiShiParefab 未赋值");
return;
return null;
}
var obj = Instantiate(TiShiParefab, uiRoot);
obj.transform.SetAsLastSibling();
var tishi = obj.GetComponent<TiShi>();
if (tishi != null)
tishi.Init(text, onConfirmAction, showClose);
return tishi;
}
IEnumerator IEShowHuoDe(List<BackPackPropItemData> backPackPropItemDatas, Action onCloseAction)
{