Browse Source

修改bug

DESKTOP-FB72PO8\Administrator 4 months ago
parent
commit
c7cee37412

+ 1 - 1
Assets/Scripts/GameLogic/Combat/CombatType/LevelBattleCombatType.cs

@@ -156,7 +156,7 @@ namespace GameLogic.Combat.CombatType
             combatItemShowEventData.startPos_WorldPos = combatHeroEntity.combatHeroGameObject.position;
             combatItemShowEventData.showName = "icon_Coin";
             combatItemShowEventData.isExp = false;
-            combatItemShowEventData.addValue = 5;
+            combatItemShowEventData.addValue =2;
             EventManager.Instance.Dispatch(CustomEventType.Combat_ItemShow, combatItemShowEventData);
 
 

+ 22 - 4
Assets/Scripts/GameLogic/Combat/Hero/CombatAIBasic.cs

@@ -49,7 +49,7 @@ public class CombatAIBasic : IDisposable
     private IHero _currFocusTarget;
 
     private BetterList<GameObject> _areaList = new BetterList<GameObject>();
-
+    private BetterList<GameObject> _HindAreaList = new BetterList<GameObject>();
     private float _t;
 
     public void Init(CombatHeroEntity combatHeroEntity, NavMeshAgent navMeshAgent)
@@ -125,6 +125,7 @@ public class CombatAIBasic : IDisposable
             else if (!alertTriggerEventData.isTrigger)
             {
                 _areaList.Remove(alertTriggerEventData.triggerObject);
+                _HindAreaList.Remove(alertTriggerEventData.triggerObject);
             }
         }
     }
@@ -156,7 +157,9 @@ public class CombatAIBasic : IDisposable
         {
             if (!_areaList[i].activeSelf)
             {
+                _HindAreaList.Remove(_areaList[i]);
                 _areaList.RemoveAt(i);
+
                 i--;
             }
         }
@@ -207,12 +210,27 @@ public class CombatAIBasic : IDisposable
 
     private void AreaUpdate()
     {
-        GameObject[] b = _combatHeroEntity.CombatAIBasic.AreaList;
-        if (b != null && b.Length > 0)
+        GameObject[] b = AreaList;
+        if (b == null)
+        {
+            return;
+        }
+
+        BetterList<GameObject> currArea = new BetterList<GameObject>();
+        for (int i = 0; i < b.Length; i++)
+        {
+            if (!_HindAreaList.Contains(AreaList[i]))
+            {
+                currArea.Add(AreaList[i]);
+                _HindAreaList.Add(AreaList[i]);
+            }
+        }
+
+        if (currArea != null && currArea.Count > 0)
         {
             float dodge = _combatHeroEntity.CurrCombatHeroInfo.dodge;
             int odds = CombatCalculateTool.Instance.GetOdd();
-            if (odds<dodge)
+            if (odds < dodge)
             {
                 CombatHeroRollingState.RollingStateData rollingStateData =
                     CObjectPool.Instance.Fetch<CombatHeroRollingState.RollingStateData>();