This commit is contained in:
2026-07-09 19:35:25 +08:00
parent 9f5a3c4cd4
commit f319455a54
10 changed files with 1175 additions and 1487 deletions
+29 -1
View File
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System;
using UnityEngine;
using System.Collections;
@@ -208,12 +208,40 @@ public class UIManager : MonoSingleton<UIManager>
}
public GameObject BoardPanelParefab;
public GameObject BoardPanelParefabGongGao;
public GameObject HuoDeParefab;
public void ShowBoardError(string str)
{
StartCoroutine(IEShowBoard(str));
}
/// <summary>
/// 显示"恭喜获得"奖励面板(随时访问,类似公告)。10秒未关闭则自动关闭。
/// </summary>
/// <param name="backPackPropItemDatas">奖励道具数据列表</param>
/// <param name="onCloseAction">关闭面板时回调(处理特殊情况)</param>
public void ShowHuoDe(List<BackPackPropItemData> backPackPropItemDatas, Action onCloseAction = null)
{
StartCoroutine(IEShowHuoDe(backPackPropItemDatas, onCloseAction));
}
IEnumerator IEShowHuoDe(List<BackPackPropItemData> backPackPropItemDatas, Action onCloseAction)
{
if (HuoDeParefab == null)
{
Debug.LogWarning("HuoDeParefab 未赋值");
yield break;
}
var obj = Instantiate(HuoDeParefab, uiRoot);
obj.transform.SetAsLastSibling();
var huode = obj.GetComponent<HuoDe>();
if (huode != null)
huode.Init(backPackPropItemDatas, onCloseAction);
// 10秒后未手动关闭则自动关闭
yield return new WaitForSeconds(10f);
if (obj != null)
huode?.Close();
}
public void ShowBoardGongGao(string str)
{