Overview
PathResult is the shared response type for path requests. It keeps movement code independent from the internal details of the pathfinding implementation.
Inspector Settings
PathResult is a data object and does not appear in the Inspector.
Public API
PathResult.Failed(string errorMessage)Creates a failed path result with an error message.
PathResult.Succeeded(List<TileCoord> tiles)Creates a successful path result with a tile list.
Runtime Properties
| Success | True when a valid path was found. |
|---|---|
| Tiles | Tiles in the calculated path. |
| ErrorMessage | Failure reason when Success is false. |
| TileCount | Number of tiles in the returned path. |
Common Usage
PathResult result = pathService.RequestPath(start, end);
if (!result.Success)
{
Debug.LogWarning(result.ErrorMessage);
return;
}