Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

DESKTOP-BGJIU14\ck 2 dní pred
rodič
commit
fb37c48e99

+ 13 - 18
Assets/Scripts/Core/UI/Core/UIManager.cs

@@ -176,7 +176,7 @@ namespace Fort23.Mono
                 UICamera = prefab.transform.GetComponentInChildren<Camera>();
                 UICamera = prefab.transform.GetComponentInChildren<Camera>();
             }
             }
 
 
-            current = EventSystem.current;
+            current = Canvas.GetComponentInChildren<EventSystem>();
             Assembly assembly = Assembly.Load("Fort23.Mono");
             Assembly assembly = Assembly.Load("Fort23.Mono");
             BackgroundPanelType = assembly.GetType(" Fort23.Mono.BackgroundPanel");
             BackgroundPanelType = assembly.GetType(" Fort23.Mono.BackgroundPanel");
 
 
@@ -240,7 +240,7 @@ namespace Fort23.Mono
         public void SetEventSystemEnable(bool value)
         public void SetEventSystemEnable(bool value)
         {
         {
             if (current != null)
             if (current != null)
-                current.enabled = value;
+                current.gameObject.SetActive(value);
         }
         }
 
 
         [CustomMethod(CustomMethodType.Update)]
         [CustomMethod(CustomMethodType.Update)]
@@ -362,7 +362,7 @@ namespace Fort23.Mono
                 {
                 {
                     if (current != null)
                     if (current != null)
                     {
                     {
-                        SetEventSystemEnable(false);
+                        // SetEventSystemEnable(false);
                     }
                     }
 
 
 
 
@@ -439,7 +439,7 @@ namespace Fort23.Mono
 
 
                         if (current != null)
                         if (current != null)
                         {
                         {
-                            SetEventSystemEnable(true);
+                            // SetEventSystemEnable(true);
                         }
                         }
 
 
 
 
@@ -464,7 +464,7 @@ namespace Fort23.Mono
                     {
                     {
                         if (current != null)
                         if (current != null)
                         {
                         {
-                            SetEventSystemEnable(true);
+                            // SetEventSystemEnable(true);
                         }
                         }
 
 
                         // 界面数据没准备好,因此本次操作将被销毁
                         // 界面数据没准备好,因此本次操作将被销毁
@@ -581,8 +581,7 @@ namespace Fort23.Mono
                     if (isShowBG)
                     if (isShowBG)
                     {
                     {
                         uiPanel.IsShowCustomBGPanel = true;
                         uiPanel.IsShowCustomBGPanel = true;
-                        if (!AllShowBGUIs.Contains(uiPanel))
-                            AllShowBGUIs.Add(uiPanel);
+
                         await GetBackgroundPanel(uiPanel, GetLayer(layer));
                         await GetBackgroundPanel(uiPanel, GetLayer(layer));
                     }
                     }
 
 
@@ -621,12 +620,6 @@ namespace Fort23.Mono
                         await uiPanel.Open();
                         await uiPanel.Open();
 
 
 
 
-                        if (current != null)
-                        {
-                            SetEventSystemEnable(true);
-                        }
-
-
                         await TimerComponent.Instance.WaitAsync(1); //等待一帧 让渲染完成后在执行完成逻辑
                         await TimerComponent.Instance.WaitAsync(1); //等待一帧 让渲染完成后在执行完成逻辑
                         callback?.Invoke(uiPanel);
                         callback?.Invoke(uiPanel);
 
 
@@ -636,14 +629,16 @@ namespace Fort23.Mono
 
 
                         if (isShowBG)
                         if (isShowBG)
                         {
                         {
+                            if (!AllShowBGUIs.Contains(uiPanel))
+                                AllShowBGUIs.Add(uiPanel);
                             var popupPanel = GetComponent(BackgroundPanelType) as UIPanel;
                             var popupPanel = GetComponent(BackgroundPanelType) as UIPanel;
-                            // popupPanel.transform.SetAsFirstSibling();
                             int index01 = uiPanel.GObjectPoolInterface.transform.GetSiblingIndex();
                             int index01 = uiPanel.GObjectPoolInterface.transform.GetSiblingIndex();
                             popupPanel.transform.SetSiblingIndex(index01 - 1);
                             popupPanel.transform.SetSiblingIndex(index01 - 1);
-                            // uiPanel.IsShowCustomBGPanel = true;
-                            // if (!AllShowBGUIs.Contains(uiPanel))
-                            //     AllShowBGUIs.Add(uiPanel);
-                            // await GetBackgroundPanel(uiPanel, GetLayer(layer));
+                        }
+
+                        if (current != null)
+                        {
+                            SetEventSystemEnable(true);
                         }
                         }
 
 
                         return uiPanel;
                         return uiPanel;

+ 1 - 16
Assets/Scripts/GameUI/UI/DivineSence/ShengShiEventWidgetType2.cs

@@ -157,22 +157,7 @@ namespace Fort23.Mono
 
 
                 Text_Eventcondition.text = desc;
                 Text_Eventcondition.text = desc;
             }
             }
-
-            // if (eventList.isCompleted)
-            // {
-            //     Text_Go.text = LanguageManager.Instance.Text(10240);
-            //     Btn_Go.image.color = new Color32(200, 199, 199, 255);
-            // }
-            // else if (eventList.isCompleted1)
-            // {
-            //     Text_Go.text = LanguageManager.Instance.Text(10157);
-            //     Btn_Go.image.color = new Color32(179, 39, 65, 255);
-            // }
-            // else
-            // {
-            //     Btn_Go.image.color = new Color32(206, 168, 105, 255);
-            // }
-
+            
 
 
             Btn_ZuiZhong.gameObject.SetActive(AccountFileInfo.Instance.playerData.CurrentZuiZhongEventListId !=
             Btn_ZuiZhong.gameObject.SetActive(AccountFileInfo.Instance.playerData.CurrentZuiZhongEventListId !=
                                               eventList.guid);
                                               eventList.guid);

+ 4 - 4
Assets/Scripts/GameUI/UI/GuidePanel/PlayerGuideManager.cs

@@ -539,7 +539,7 @@ namespace Fort23.Mono
                 return;
                 return;
             }
             }
 
 
-            UIManager.Instance.SetEventSystemEnable(false);
+            // UIManager.Instance.SetEventSystemEnable(false);
 
 
 
 
             curPhase = phase;
             curPhase = phase;
@@ -551,7 +551,7 @@ namespace Fort23.Mono
             GuidePanel guildPanel =
             GuidePanel guildPanel =
                 await UIManager.Instance.LoadAndOpenPanel<GuidePanel>(null, UILayer.Top, isFocus: false);
                 await UIManager.Instance.LoadAndOpenPanel<GuidePanel>(null, UILayer.Top, isFocus: false);
             dialogBox.Init();
             dialogBox.Init();
-            UIManager.Instance.SetEventSystemEnable(true);
+            // UIManager.Instance.SetEventSystemEnable(true);
 
 
             finger = guildPanel.GuideHand;
             finger = guildPanel.GuideHand;
             fxTrans01 = guildPanel.FocusFrame01;
             fxTrans01 = guildPanel.FocusFrame01;
@@ -754,7 +754,7 @@ namespace Fort23.Mono
             SetBlackAlpha(guideConfig.blackAlpha);
             SetBlackAlpha(guideConfig.blackAlpha);
             ShowDialogBox(action, str);
             ShowDialogBox(action, str);
             await dialogBox.SetDiTex(guideConfig, guideConfig.SpeakerImage);
             await dialogBox.SetDiTex(guideConfig, guideConfig.SpeakerImage);
-            UIManager.Instance.SetEventSystemEnable(true);
+            // UIManager.Instance.SetEventSystemEnable(true);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -1215,7 +1215,7 @@ namespace Fort23.Mono
         /// </summary>
         /// </summary>
         public void StepInit()
         public void StepInit()
         {
         {
-            UIManager.Instance.SetEventSystemEnable(false);
+           
             _customVectorTween?.Kill();
             _customVectorTween?.Kill();
             _customVectorTween = null;
             _customVectorTween = null;
             UIManager.Instance.GetComponent<GuidePanel>().transform.SetAsLastSibling();
             UIManager.Instance.GetComponent<GuidePanel>().transform.SetAsLastSibling();

+ 23 - 4
Assets/Scripts/GameUI/UI/QiankundaiPanel/QiankundaiInfoPanel.cs

@@ -56,6 +56,7 @@ namespace Fort23.Mono
             }
             }
 
 
 
 
+            List<ItemInfo> itemInfos = new List<ItemInfo>();
             foreach (var qiankundaiConfig in qiankundaiConfigs)
             foreach (var qiankundaiConfig in qiankundaiConfigs)
             {
             {
                 for (var i = 0; i < qiankundaiConfig.ChoukaID.Length; i++)
                 for (var i = 0; i < qiankundaiConfig.ChoukaID.Length; i++)
@@ -64,6 +65,7 @@ namespace Fort23.Mono
                     {
                     {
                         List<ItemInfo> itemInfo = DropManager.Instance.Drop(qiankundaiConfig.ChoukaID[i],
                         List<ItemInfo> itemInfo = DropManager.Instance.Drop(qiankundaiConfig.ChoukaID[i],
                             qiankundaiConfig.DropCount[i]);
                             qiankundaiConfig.DropCount[i]);
+                        itemInfos.AddRange(itemInfo);
                         foreach (var info in itemInfo)
                         foreach (var info in itemInfo)
                         {
                         {
                             WidgetItem widgetItem =
                             WidgetItem widgetItem =
@@ -77,15 +79,32 @@ namespace Fort23.Mono
                         DropConfig dropConfig = ConfigComponent.Instance.Get<DropConfig>(qiankundaiConfig.ChoukaID[i]);
                         DropConfig dropConfig = ConfigComponent.Instance.Get<DropConfig>(qiankundaiConfig.ChoukaID[i]);
                         foreach (var i1 in dropConfig.showItemId)
                         foreach (var i1 in dropConfig.showItemId)
                         {
                         {
-                            WidgetItem widgetItem =
-                                await UIManager.Instance.CreateGComponent<WidgetItem>(null, Content);
-                            widgetItem.InitWidget(new ItemInfo(i1, 0));
-                            items.Add(widgetItem);
+                            itemInfos.Add(new ItemInfo(i1, 0));
+                            // WidgetItem widgetItem =
+                            //     await UIManager.Instance.CreateGComponent<WidgetItem>(null, Content);
+                            // widgetItem.InitWidget(new ItemInfo(i1, 0));
+                            // items.Add(widgetItem);
                         }
                         }
                     }
                     }
                 }
                 }
             }
             }
 
 
+
+            using (CTaskAwaitBuffer<WidgetItem> cta = new CTaskAwaitBuffer<WidgetItem>())
+            {
+                foreach (var itemInfo in itemInfos)
+                {
+                    cta.AddTask(UIManager.Instance.CreateGComponent<WidgetItem>(null, Content));
+                  
+                }
+                items = await cta.WaitAll();
+            }
+
+            for (var i = 0; i < itemInfos.Count; i++)
+            {
+                items[i].InitWidget(itemInfos[i]);
+            }
+
             return await base.AsyncInit(uiData);
             return await base.AsyncInit(uiData);
         }
         }
 
 

+ 26 - 16
Assets/Scripts/GameUI/UI/QiankundaiPanel/QiankundaiPanel.cs

@@ -73,7 +73,7 @@ namespace Fort23.Mono
 
 
                 RewardsPanel.OpenPanel(itemInfos);
                 RewardsPanel.OpenPanel(itemInfos);
                 CustomInit();
                 CustomInit();
-                
+
                 RedDotManager.Instance.AllRedDotUpDate();
                 RedDotManager.Instance.AllRedDotUpDate();
             });
             });
 
 
@@ -94,14 +94,16 @@ namespace Fort23.Mono
             }
             }
 
 
             items.Clear();
             items.Clear();
-   
+
             Text_Desc.text =
             Text_Desc.text =
                 LanguageManager.Instance.Text(10172,
                 LanguageManager.Instance.Text(10172,
                     UtilTools.TimeToHSM(AccountFileInfo.Instance.playerData.QiankundaiDropTimer),
                     UtilTools.TimeToHSM(AccountFileInfo.Instance.playerData.QiankundaiDropTimer),
                     UtilTools.TimeToHSM(PlayerManager.Instance.gameConstantConfig.qiankundaiMaxTime));
                     UtilTools.TimeToHSM(PlayerManager.Instance.gameConstantConfig.qiankundaiMaxTime));
-    
-            
-            
+
+
+            List<ItemInfo> itemInfos = new List<ItemInfo>();
+
+
             //可以掉落每日刷新奖励
             //可以掉落每日刷新奖励
             if (TimeHelper.ClientNow() >= AccountFileInfo.Instance.playerData.QiankundaiLingQuDailyDropTime)
             if (TimeHelper.ClientNow() >= AccountFileInfo.Instance.playerData.QiankundaiLingQuDailyDropTime)
             {
             {
@@ -112,24 +114,32 @@ namespace Fort23.Mono
                     {
                     {
                         List<ItemInfo> itemInfo = DropManager.Instance.Drop(qiankundaiConfig.ChoukaID[i],
                         List<ItemInfo> itemInfo = DropManager.Instance.Drop(qiankundaiConfig.ChoukaID[i],
                             qiankundaiConfig.DropCount[i]);
                             qiankundaiConfig.DropCount[i]);
-                        foreach (var info in itemInfo)
-                        {
-                            WidgetItem widgetItem = await UIManager.Instance.CreateGComponent<WidgetItem>(null, Content);
-                            widgetItem.InitWidget(info);
-                            items.Add(widgetItem);
-                        }
+                        itemInfos.AddRange(itemInfo);
+          
                     }
                     }
                 }
                 }
             }
             }
-            
-            
+
+
             foreach (var playerDataQiankundaiItemData in AccountFileInfo.Instance.playerData.QiankundaiItemDatas)
             foreach (var playerDataQiankundaiItemData in AccountFileInfo.Instance.playerData.QiankundaiItemDatas)
             {
             {
-                WidgetItem widgetItem = await UIManager.Instance.CreateGComponent<WidgetItem>(null, Content);
-                widgetItem.InitWidget(new ItemInfo(playerDataQiankundaiItemData));
-                items.Add(widgetItem);
+                itemInfos.Add(new ItemInfo(playerDataQiankundaiItemData));
+   
             }
             }
 
 
+            using (CTaskAwaitBuffer<WidgetItem> cta = new CTaskAwaitBuffer<WidgetItem>())
+            {
+                for (var i = 0; i < itemInfos.Count; i++)
+                {
+                    cta.AddTask(UIManager.Instance.CreateGComponent<WidgetItem>(null, Content));
+                }
+                items = await cta.WaitAll();
+            }
+
+            for (var i = 0; i < itemInfos.Count; i++)
+            {
+                items[i].InitWidget(itemInfos[i]);
+            }
         }
         }
 
 
         public static async CTask OpenPanel()
         public static async CTask OpenPanel()