【战斗】调整巡逻逻辑
parent
780992743f
commit
96f5cde7b7
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue