| | |
| | | |
| | | // 只在“没有战斗”和“主线战斗”和“自己的战场”时允许弹窗 |
| | | string activeBattleName = BattleManager.Instance.GetActiveBattleName(); |
| | | if (activeBattleName != "" && activeBattleName != "StoryBattleField" && activeBattleName != popupWindowQueue[0].battleFieldName) |
| | | // 查找队列中第一个可以弹出的弹窗 |
| | | PopupWindow targetPopup = null; |
| | | int targetIndex = -1; |
| | | for (int i = 0; i < popupWindowQueue.Count; i++) |
| | | { |
| | | var popup = popupWindowQueue[i]; |
| | | if (activeBattleName == "" || activeBattleName == "StoryBattleField" || activeBattleName == popup.battleFieldName) |
| | | { |
| | | targetPopup = popup; |
| | | targetIndex = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (targetPopup == null) |
| | | return; |
| | | |
| | | if (UIManager.Instance.IsOpened(popupWindowQueue[0].window)) |
| | | if (UIManager.Instance.IsOpened(targetPopup.window)) |
| | | { |
| | | //当前模式可以打开多个相同窗口,增加防范 |
| | | return; |
| | | } |
| | | |
| | | if (UIManager.Instance.ExistAnyFullScreenOrMaskWin(popupWindowQueue[0].window)) |
| | | if (UIManager.Instance.ExistAnyFullScreenOrMaskWin(targetPopup.window)) |
| | | return; |
| | | |
| | | if (currentWindow != null && currentWindow.window != null) |
| | |
| | | return; |
| | | } |
| | | |
| | | currentWindow = popupWindowQueue[0]; |
| | | popupWindowQueue.RemoveAt(0); |
| | | currentWindow = targetPopup; |
| | | popupWindowQueue.RemoveAt(targetIndex); |
| | | UIManager.Instance.OpenWindow(currentWindow.window, currentWindow.functionId); |
| | | Debug.LogFormat("推送窗口 " + currentWindow.window); |
| | | |