Bläddra i källkod

刷出的神识添加一个上限

lzx 3 dagar sedan
förälder
incheckning
c1daab0cb9

+ 5 - 0
Assets/Res/UI/DialoguePanel/DialoguePanel.prefab

@@ -244,6 +244,11 @@ MonoBehaviour:
     isAssetBundle: 0
     isList: 0
     ListCollectorDatas: []
+  - key: Dialgue
+    gameObject: {fileID: 3275273584098972649}
+    isAssetBundle: 0
+    isList: 0
+    ListCollectorDatas: []
   isAssetBundle: 1
 --- !u!1 &6013513864245940534
 GameObject:

+ 9 - 3
Assets/Scripts/GameLogic/EventManager/EventSystemManager.cs

@@ -56,6 +56,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
     public List<AccountFileInfo.EventList> UseDivinesense(int bigMapId)
     {
         DivineSenseConfig divineSenseConfig = ConfigComponent.Instance.Get<DivineSenseConfig>(AccountFileInfo.Instance.playerData.divineSenseLevel);
+        HeroPowerUpConfig heroPowerUpConfig = ConfigComponent.Instance.Get<HeroPowerUpConfig>(1);
         int count = AccountFileInfo.Instance.playerData.divineSensePoint / PlayerManager.Instance.gameConstantConfig.DetectEventCount;
         if (count <= 0)
         {
@@ -63,8 +64,13 @@ public class EventSystemManager : Singleton<EventSystemManager>
             return null;
         }
 
-        AccountFileInfo.Instance.playerData.divineSenseexp += AccountFileInfo.Instance.playerData.divineSensePoint;
-        AccountFileInfo.Instance.playerData.divineSensePoint = 0;
+        int maxCount = heroPowerUpConfig.ShenshiMax / PlayerManager.Instance.gameConstantConfig.DetectEventCount;
+        count = count + AccountFileInfo.Instance.playerData.eventList.Count > maxCount ? maxCount - AccountFileInfo.Instance.playerData.eventList.Count : count;
+
+        int xiaoHao = count * PlayerManager.Instance.gameConstantConfig.DetectEventCount;
+
+        AccountFileInfo.Instance.playerData.divineSenseexp += xiaoHao;
+        AccountFileInfo.Instance.playerData.divineSensePoint -= xiaoHao;
         EventManager.Instance.Dispatch(CustomEventType.DivineSensePointChange, null);
         // 神识升级逻辑
         UpDivinesense();
@@ -307,7 +313,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         AccountFileInfo.Instance.playerData.events.Add(eventData);
 
         if (AccountFileInfo.Instance.playerData.senceExplorationProgress < 100)
-            AccountFileInfo.Instance.playerData.senceExplorationProgress += 5;
+            AccountFileInfo.Instance.playerData.senceExplorationProgress += 1;
 
 
         AccountFileInfo.Instance.playerData.eventList.Remove(CurrentEventList);

+ 5 - 0
Assets/Scripts/GameUI/UI/DialoguePanel/DialogueOptionWidget.cs

@@ -3,6 +3,8 @@ using System.Linq;
 using Core.Language;
 using Excel2Json;
 using Fort23.UTool;
+using UnityEngine;
+using UnityEngine.UI;
 
 namespace Fort23.Mono
 {
@@ -37,6 +39,9 @@ namespace Fort23.Mono
             int index = mainEventConditionConfig.optionPara1.ToList().IndexOf(eventConditionConfig.ID);
             Text_desc.text = LanguageManager.Instance.Text(mainEventConditionConfig.optionPara2[index]);
             this.callback = callback;
+           
+             LayoutRebuilder.ForceRebuildLayoutImmediate(Text_desc.GetComponent<RectTransform>());
+             LayoutRebuilder.ForceRebuildLayoutImmediate(transform);
         }
     }
 }

+ 6 - 0
Assets/Scripts/GameUI/UI/DialoguePanel/DialoguePanel.cs

@@ -6,6 +6,7 @@ using Fort23.UTool;
 using UnityEngine;
 using System;
 using Fort23.Core;
+using UnityEngine.UI;
 
 namespace Fort23.Mono
 {
@@ -157,6 +158,8 @@ namespace Fort23.Mono
                     _skipTyping = false;
                     break;
             }
+
+            LayoutRebuilder.ForceRebuildLayoutImmediate(Dialgue);
         }
 
         private async void ShowOptions()
@@ -172,6 +175,8 @@ namespace Fort23.Mono
                     await UIManager.Instance.CreateGComponent<DialogueOptionWidget>(null, OptionRoot);
                 dialogueOptionWidget.CustomInit(op, eventConditionConfig.ID, SelectOption);
             }
+
+            LayoutRebuilder.ForceRebuildLayoutImmediate(Dialgue);
         }
 
         private void SelectOption(DialogueOptionWidget obj)
@@ -212,6 +217,7 @@ namespace Fort23.Mono
                             ShowOptions();
                         }
                     }
+
                     // StartShowMassge();
                     // ShowNextIcon();
                     return;

+ 11 - 0
Assets/Scripts/GameUI/UI/DialoguePanel/DialoguePanelData.cs

@@ -63,6 +63,17 @@ namespace Fort23.Mono
 	      return _OptionRoot;
 	     }
 	   }
+	  private RectTransform _Dialgue;
+	  public RectTransform Dialgue
+	   {
+	   get{
+	      if (_Dialgue == null)
+	       {
+	         _Dialgue  = GetUIUnit<RectTransform>("Dialgue"); 
+	       }
+	      return _Dialgue;
+	     }
+	   }
 	  #endregion 自定义数据结束 
 	 public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
 	{