| | |
| | | } |
| | | |
| | | popupWindowQueue.Add(popupWindow); |
| | | popupWindowQueue.Sort((x, y) => y.isNeedHomeWin.CompareTo(x.isNeedHomeWin)); |
| | | popupWindowQueue.Sort((x, y) => |
| | | { |
| | | // 1. 首先按 isNeedHomeWin 排序 (true 排在前面) |
| | | int homeWinCompare = y.isNeedHomeWin.CompareTo(x.isNeedHomeWin); |
| | | if (homeWinCompare != 0) |
| | | return homeWinCompare; |
| | | |
| | | // 2. 获取各自的 WinOrder (通过 WinName 查找配置表) |
| | | int xOrder = GetWinOrder(x.window); |
| | | int yOrder = GetWinOrder(y.window); |
| | | int orderCompare = xOrder.CompareTo(yOrder); |
| | | if (orderCompare != 0) |
| | | return orderCompare; |
| | | |
| | | // 3. WinOrder 相同时,按 ID 排序 (ID 小的排前面) |
| | | return x.functionId.CompareTo(y.functionId); |
| | | }); |
| | | } |
| | | |
| | | private int GetWinOrder(string winName) |
| | | { |
| | | var allConfigs = PopWinOrderConfig.GetValues(); |
| | | foreach (var config in allConfigs) |
| | | { |
| | | if (config.WinName == winName) |
| | | { |
| | | return config.WinOrder; |
| | | } |
| | | } |
| | | return int.MinValue; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerAttrConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(PopWinOrderConfig),
|
| | | typeof(PresetUnlockConfig),
|
| | | typeof(PriorBundleConfig),
|
| | | typeof(RandomNameConfig),
|
| | |
| | | ClearConfigDictionary<PlayerAttrConfig>();
|
| | | // 清空 PlayerFaceConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 PopWinOrderConfig 字典
|
| | | ClearConfigDictionary<PopWinOrderConfig>();
|
| | | // 清空 PresetUnlockConfig 字典
|
| | | ClearConfigDictionary<PresetUnlockConfig>();
|
| | | // 清空 PriorBundleConfig 字典
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年2月27日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class PopWinOrderConfig : ConfigBase<int, PopWinOrderConfig> |
| | | { |
| | | static PopWinOrderConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int ID; |
| | | public string WinName; |
| | | public int WinOrder; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | | int key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out ID); |
| | | |
| | | WinName = tables[1]; |
| | | |
| | | int.TryParse(tables[2],out WinOrder); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a5c6d2fdaab52b44a824d683ed361ddf |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |