lzx 4 napja
szülő
commit
90f1ceeaea

+ 6 - 1
Assets/Res/UI/DivineSence/DivineSenceEventPreviewPanel.prefab

@@ -99,6 +99,11 @@ MonoBehaviour:
     isAssetBundle: 0
     isList: 0
     ListCollectorDatas: []
+  - key: Text_ShenShiCount
+    gameObject: {fileID: 8733058899712714278}
+    isAssetBundle: 0
+    isList: 0
+    ListCollectorDatas: []
   isAssetBundle: 1
 --- !u!114 &5478100459915039784
 MonoBehaviour:
@@ -934,7 +939,7 @@ GameObject:
   - component: {fileID: 8733058899712714278}
   m_Layer: 0
   m_HasEditorInfo: 1
-  m_Name: Text (Legacy) (1)
+  m_Name: Text_ShenShiCount
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0

+ 19 - 5
Assets/Scripts/GameUI/EventManager/EventSystemManager.cs

@@ -93,10 +93,9 @@ public class EventSystemManager : Singleton<EventSystemManager>
             if (eventList.isCompleted)
             {
                 removeEvents.Add(eventList);
-               
             }
         }
-        
+
         foreach (var removeEvent in removeEvents)
         {
             AccountFileInfo.Instance.playerData.completeEvents.Add(removeEvent);
@@ -115,7 +114,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
         }
 
         int maxCount = heroPowerUpConfig.ShenshiMax / PlayerManager.Instance.gameConstantConfig.DetectEventCount;
-        count = count + AccountFileInfo.Instance.playerData.eventList.Count > maxCount ? maxCount - AccountFileInfo.Instance.playerData.eventList.Count : count;
+        count = count + GetShenShiCount() > maxCount ? maxCount - GetShenShiCount() : count;
 
 
         EventManager.Instance.Dispatch(CustomEventType.DivineSensePointChange, null);
@@ -147,7 +146,7 @@ public class EventSystemManager : Singleton<EventSystemManager>
             {
                 AccountFileInfo.Instance.playerData.CurrentZuiZhongEventList = mainEventData;
             }
-            else
+            else if (AccountFileInfo.Instance.playerData.eventList.Count > 0)
             {
                 AccountFileInfo.Instance.playerData.CurrentZuiZhongEventList = AccountFileInfo.Instance.playerData.eventList[0];
             }
@@ -166,7 +165,22 @@ public class EventSystemManager : Singleton<EventSystemManager>
         }
 
         AccountFileInfo.Instance.SavePlayerData();
-    } 
+    }
+
+
+    public int GetShenShiCount()
+    {
+        int count = 0;
+        foreach (var eventList in AccountFileInfo.Instance.playerData.eventList)
+        {
+            EventConfig eventConfig = ConfigComponent.Instance.Get<EventConfig>(eventList.eventID);
+            if (eventConfig.EventTriggerType != 5)
+            {
+                count++;
+            }
+        }
+        return count;
+    }
 
 
     public bool BagIsEvent(int eventID)

+ 27 - 21
Assets/Scripts/GameUI/UI/DivineSence/DivineSenceEventPreviewPanel.cs

@@ -48,14 +48,7 @@ namespace Fort23.Mono
                 if (saixuanType == 1)
                     return;
                 saixuanType = 1;
-                SaiXuan(1);
-                foreach (var shengShiEventWidgetType2 in shengShiEventWidgetTypeList)
-                {
-                    UIManager.Instance.DormancyGComponent(shengShiEventWidgetType2);
-                }
-
-                shengShiEventWidgetTypeList.Clear();
-                await Content.Init(this, showEventList.Count);
+                UpdateContent();
             });
 
             Btn_DaoYou.onClick.AddListener(async () =>
@@ -63,20 +56,15 @@ namespace Fort23.Mono
                 if (saixuanType == 2)
                     return;
                 saixuanType = 2;
-                SaiXuan(2);
-                foreach (var shengShiEventWidgetType2 in shengShiEventWidgetTypeList)
-                {
-                    UIManager.Instance.DormancyGComponent(shengShiEventWidgetType2);
-                }
-                shengShiEventWidgetTypeList.Clear();
-                await Content.Init(this, showEventList.Count);
+                UpdateContent();
             });
         }
 
         private void RemoveEvent(IEventData e)
         {
-            UIManager.Instance.DormancyAllGComponent<ShengShiEventWidgetType2>();
-            Content.Init(this, showEventList.Count);
+            // UIManager.Instance.DormancyAllGComponent<ShengShiEventWidgetType2>();
+            // Content.Init(this, showEventList.Count);
+            UpdateContent();
         }
 
         public async override CTask<bool> AsyncInit(object[] uiData)
@@ -85,11 +73,27 @@ namespace Fort23.Mono
             ShengShiEventWidgetType2 shengShiEventWidgetType2 = await UIManager.Instance.CreateGComponent<ShengShiEventWidgetType2>(null, ShengShiEventWidgetType2Root);
             shengShiEventWidgetType2.CustomInit(eventList, GoOnClick);
             shengShiEventWidgetType2.OnClick = OnClick;
-            SaiXuan(1);
-            await Content.Init(this, showEventList.Count);
+
+            await UpdateContent();
             return await base.AsyncInit(uiData);
         }
 
+        private async CTask UpdateContent()
+        {
+            foreach (var shengShiEventWidgetType2 in shengShiEventWidgetTypeList)
+            {
+                UIManager.Instance.DormancyGComponent(shengShiEventWidgetType2);
+            }
+
+            shengShiEventWidgetTypeList.Clear();
+
+            int maxCount = PlayerManager.Instance.myHero.powerUpConfig.ShenshiMax / PlayerManager.Instance.gameConstantConfig.DetectEventCount;
+
+            Text_ShenShiCount.text = $"神识{EventSystemManager.Instance.GetShenShiCount()}/{maxCount}";
+            SaiXuan(saixuanType);
+            await Content.Init(this, showEventList.Count);
+        }
+
 
         public void SaiXuan(int type)
         {
@@ -146,9 +150,10 @@ namespace Fort23.Mono
 
             EventSystemManager.Instance.TriggerEvent(shengShiEventWidgetType2.eventList, () =>
             {
-                Content.Init(this, showEventList.Count);
+                // Content.Init(this, showEventList.Count);
                 this.GObjectPoolInterface.SetActive(true);
-                EventSystemManager.Instance.isOpenUi = true;
+                UpdateContent();
+                // EventSystemManager.Instance.isOpenUi = true;
             });
         }
 
@@ -176,6 +181,7 @@ namespace Fort23.Mono
             UIManager.Instance.DormancyAllGComponent<ShengShiEventWidgetType2>();
             shengShiEventWidgetTypeList.Clear();
             EventSystemManager.Instance.isOpenUi = false;
+            saixuanType = 1;
             base.Close();
         }
     }

+ 22 - 11
Assets/Scripts/GameUI/UI/DivineSence/DivineSenceEventPreviewPanelData.cs

@@ -52,17 +52,6 @@ namespace Fort23.Mono
 	      return _ContentRoot;
 	     }
 	   }
-	  private Button _Btn_Close;
-	  public Button Btn_Close
-	   {
-	   get{
-	      if (_Btn_Close == null)
-	       {
-	         _Btn_Close  = GetUIUnit<Button>("Btn_Close"); 
-	       }
-	      return _Btn_Close;
-	     }
-	   }
 	  private RectTransform _ShengShiEventWidgetType2Root;
 	  public RectTransform ShengShiEventWidgetType2Root
 	   {
@@ -96,6 +85,28 @@ namespace Fort23.Mono
 	      return _Btn_DaoYou;
 	     }
 	   }
+	  private Button _Btn_Close;
+	  public Button Btn_Close
+	   {
+	   get{
+	      if (_Btn_Close == null)
+	       {
+	         _Btn_Close  = GetUIUnit<Button>("Btn_Close"); 
+	       }
+	      return _Btn_Close;
+	     }
+	   }
+	  private Text _Text_ShenShiCount;
+	  public Text Text_ShenShiCount
+	   {
+	   get{
+	      if (_Text_ShenShiCount == null)
+	       {
+	         _Text_ShenShiCount  = GetUIUnit<Text>("Text_ShenShiCount"); 
+	       }
+	      return _Text_ShenShiCount;
+	     }
+	   }
 	  #endregion 自定义数据结束 
 	 public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
 	{

+ 1 - 1
Assets/Scripts/GameUI/UI/DivineSence/DivineSenceEventResultPanel.cs

@@ -43,7 +43,7 @@ namespace Fort23.Mono
         public override CTask<bool> AsyncInit(object[] uiData)
         {
             eventList = uiData[0] as List<AccountFileInfo.EventList>;
-
+         
             if (eventList != null && eventList.Count > 0)
                 Content.Init(this, eventList.Count);