| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | |
| | | { |
| | | // 弹窗队列,存储待处理的弹窗请求 |
| | | List<PopupWindow> popupWindowQueue = new List<PopupWindow>(); |
| | | |
| | | |
| | | // 当前正在显示的弹窗 |
| | | PopupWindow currentWindow; |
| | | |
| | | float firstTime = 0; //打开HomeWin时的时间 |
| | | float stayTime; |
| | | bool homeWinFirstOpened = false; //HomeWin是否第一次打开 |
| | | |
| | | |
| | | // 上次弹窗时间,用于控制弹窗之间的间隔 |
| | | float lastTime = 0; //上次弹窗时间 |
| | | |
| | | |
| | | /// <summary> |
| | | /// 添加一个弹窗到处理队列 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// LateUpdate中处理弹窗队列,确保在所有其他逻辑处理完毕后才显示弹窗 |
| | | /// </summary> |
| | |
| | | if (!UIManager.Instance.IsOpened<HomeWin>()) |
| | | return; |
| | | |
| | | // 第一次打开HomeWin时记录时间 |
| | | if (!homeWinFirstOpened) |
| | | { |
| | | firstTime = Time.realtimeSinceStartup; |
| | | homeWinFirstOpened = true; |
| | | stayTime = float.Parse(FuncConfigConfig.Get("PopWin").Numerical1); |
| | | return; |
| | | } |
| | | // 等待x秒 |
| | | if (Time.realtimeSinceStartup - firstTime < stayTime) |
| | | return; |
| | | |
| | | if (UIManager.Instance.IsOpened(popupWindowQueue[0].window)) |
| | | { |
| | |
| | | |
| | | if (UIManager.Instance.ExistAnyFullScreenOrMaskWin(popupWindowQueue[0].window)) |
| | | return; |
| | | |
| | | |
| | | |
| | | if (currentWindow.window != null) |
| | | { |
| | |
| | | { |
| | | // 窗口名称 |
| | | public string window; |
| | | |
| | | |
| | | // 功能ID,用于指定窗口的具体功能或显示模式 |
| | | public int functionId; |
| | | |