| | |
| | | using TowerDefense.UI.HUD; |
| | | using UnityEngine; |
| | | using UnityEngine.AI; |
| | | using TowerDefense.Level; |
| | | |
| | | /// <summary> |
| | | /// 基于兵线的Agent Instance管理器 |
| | |
| | | // 这一行防止无限的循环下去。 |
| | | if (forceGet) return ag; |
| | | |
| | | Agent agLeft = GetMinDisAgent(lineid - 1, oppo, true, noPoison); |
| | | Agent agRight = GetMinDisAgent(lineid + 1, oppo, true, noPoison); |
| | | |
| | | agentTmpArr[0] = ag; |
| | | agentTmpArr[1] = agLeft; |
| | | agentTmpArr[2] = agRight; |
| | | |
| | | if (!EndlessLevelManager.instanceExists) |
| | | { |
| | | Agent agLeft = GetMinDisAgent(lineid - 1, oppo, true, noPoison); |
| | | Agent agRight = GetMinDisAgent(lineid + 1, oppo, true, noPoison); |
| | | |
| | | agentTmpArr[1] = agLeft; |
| | | agentTmpArr[2] = agRight; |
| | | } |
| | | else |
| | | { |
| | | agentTmpArr[1] = null; |
| | | agentTmpArr[2] = null; |
| | | } |
| | | |
| | | float minDis = 100000000f; |
| | | int idx = -1; |