Browse Source

修改bug

lzx 8 hours ago
parent
commit
0c32bac8b6

+ 10 - 9
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouInfoPanel.cs

@@ -177,9 +177,9 @@ namespace Fort23.Mono
 
                     for (var i = daoYouData.favorabilityLv; i < configs.Length; i++)
                     {
-                        if (daoYouData.exp >= configs[i-1].exp)
+                        if (daoYouData.exp >= configs[i - 1].exp)
                         {
-                            daoYouData.exp -= configs[i-1].exp;
+                            daoYouData.exp -= configs[i - 1].exp;
                             daoYouData.favorabilityLv++;
                         }
                         else
@@ -199,6 +199,7 @@ namespace Fort23.Mono
                         TipMessagePanel.OpenTipMessagePanel("心情已经到最高");
                         return;
                     }
+
                     //TODO 消耗:送礼给道友
                     PlayerManager.Instance.BagController.DeductItem(widgetItem1.itemInfo.itemID, count);
                     daoYouData.emotionValue += widgetItem1.itemInfo.config.associateVlaue[0];
@@ -410,7 +411,7 @@ namespace Fort23.Mono
             _daoYouLevelWidgets = cts1.GetResultsLists();
             for (var i = 0; i < configs.Length; i++)
             {
-                _daoYouLevelWidgets[i].CustomInit(daoYouData, configs[i].ID);
+                await _daoYouLevelWidgets[i].CustomInit(daoYouData, configs[i].ID);
             }
 
             taskAwaitBuffer?.Dispose();
@@ -532,13 +533,13 @@ namespace Fort23.Mono
             }
 
             widgetItem1.InitWidget(widgetItem.itemInfo);
-            
+
             Icon_Select.transform.SetParent(widgetItem.transform);
             Icon_Select.transform.SetAsFirstSibling();
             Icon_Select.transform.GetComponent<RectTransform>().anchoredPosition = Vector2.zero;
             Icon_Select.gameObject.SetActive(true);
-            
-       
+
+
             daoyouGiftConfig = default;
 
             foreach (var giftConfig in daoyouGiftConfigs)
@@ -619,11 +620,11 @@ namespace Fort23.Mono
             Slider_Give.value = 0;
             Slider_Give.minValue = 0;
             Slider_Give.maxValue = 0;
-            
-            
+
+
             Icon_Select.transform.SetParent(GiveGite.transform);
             Icon_Select.gameObject.SetActive(false);
-            
+
 
             foreach (var giveWidgetItem in giveWidgetItems)
             {

+ 2 - 1
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouLevelWidget.cs

@@ -2,6 +2,7 @@ using System.Collections.Generic;
 using System.Linq;
 using Core.Language;
 using Excel2Json;
+using Fort23.Core;
 using Fort23.UTool;
 using GameLogic.Bag;
 
@@ -67,7 +68,7 @@ namespace Fort23.Mono
             });
         }
 
-        public async void CustomInit(AccountFileInfo.DaoYouData daoYouData, int configId)
+        public async CTask CustomInit(AccountFileInfo.DaoYouData daoYouData, int configId)
         {
             this.daoYouData = daoYouData;
             _daoyouLevelupConfig = ConfigComponent.Instance.Get<DaoyouLevelupConfig>(configId);