|
@@ -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>();
|