diff options
author | chai <215380520@qq.com> | 2024-05-23 10:08:29 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-05-23 10:08:29 +0800 |
commit | 8722a9920c1f6119bf6e769cba270e63097f8e25 (patch) | |
tree | 2eaf9865de7fb1404546de4a4296553d8f68cc3b /Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Core/Misc/PathPartWithLinkInfo.cs | |
parent | 3ba4020b69e5971bb0df7ee08b31d10ea4d01937 (diff) |
+ astar project
Diffstat (limited to 'Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Core/Misc/PathPartWithLinkInfo.cs')
-rw-r--r-- | Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Core/Misc/PathPartWithLinkInfo.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Core/Misc/PathPartWithLinkInfo.cs b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Core/Misc/PathPartWithLinkInfo.cs new file mode 100644 index 0000000..d09535c --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Core/Misc/PathPartWithLinkInfo.cs @@ -0,0 +1,32 @@ +namespace Pathfinding.Util { + /// <summary> + /// Represents a part of a path, with optional link information. + /// + /// A path is divided up into parts, where each part is either a sequence of nodes or an off-mesh link. + /// If your agent never traverses off-mesh links, the path will always consist of only a single part which is a sequence of nodes. + /// </summary> + public struct PathPartWithLinkInfo { + public PathPartWithLinkInfo(int startIndex, int endIndex, OffMeshLinks.OffMeshLinkTracer linkInfo = default) { + this.startIndex = startIndex; + this.endIndex = endIndex; + this.linkInfo = linkInfo; + } + + /// <summary> + /// Index of the first point in the path that this part represents. + /// + /// For off-mesh links, this will refer to the last point in the part before the off-mesh link. + /// </summary> + public int startIndex; + /// <summary> + /// Index of the last point in the path that this part represents. + /// + /// For off-mesh links, this will refer to the first point in the part after the off-mesh link. + /// </summary> + public int endIndex; + /// <summary>The off-mesh link that this part represents. Will contain a null link if this part is not an off-mesh link</summary> + public OffMeshLinks.OffMeshLinkTracer linkInfo; + /// <summary>Specifies if this is a sequence of nodes, or an off-mesh link</summary> + public Funnel.PartType type => linkInfo.link != null ? Funnel.PartType.OffMeshLink : Funnel.PartType.NodeSequence; + } +} |