【战斗】调整巡逻逻辑

main
刘涛 2024-08-14 20:00:00 +08:00
parent 780992743f
commit 96f5cde7b7
1 changed files with 14 additions and 3 deletions

View File

@ -95,6 +95,17 @@ namespace Gameplay
}
return true;
}
private static bool _CheckEndCanPass(int to,
GameUnit moveUnit)
{
var map = LevelManager.Instance.CurrentLevel.Map;
var crossLevel = moveUnit.commonData.crossLevel;
map.GetRuntimeBlockProperty(to, out var runtimeBlockProperty);
if (runtimeBlockProperty.isEmptyBlock) return false;
if (crossLevel <= runtimeBlockProperty.crossLevel) return false;
return true;
}
public static List<int> FindPath(Map map,
int to,
@ -118,14 +129,14 @@ namespace Gameplay
return result;
}
_RuntimeMarkMapCrossState(moveUnit);
if (!CanPass(to, moveUnit))
if (!_CheckEndCanPass(to, moveUnit))
{
// 如果终点不可通行,直接走无法走通的逻辑
// 地形层面的不可通行
canReach = false;
}
_RuntimeMarkMapCrossState(moveUnit);
var toData = default(RuntimeBlockProperty);