コード例 #1
0
    public static PathData FindPath(PathFinderPoint start, PathFinderPoint end, Vector2 offset)
    {
        var path     = pathfinder.FindPath(start, end);
        var pathData = new PathData(path, offset);

        return(pathData);
    }
コード例 #2
0
    public static PathData FindPath(PathFinderPoint start, PathFinderPoint end)
    {
        var path     = pathfinder.FindPath(start, end);
        var pathData = new PathData(path);

        return(pathData);
    }
コード例 #3
0
    private void ConnectDoors(GameObject a, GameObject b)
    {
        var positionA = LevelSystem.Instance.ToVec2i(
            a.transform.position);

        var positionB = LevelSystem.Instance.ToVec2i(
            b.transform.position);

        PathFinderUtil.SetMap(tileMap);

        var pointA   = new PathFinderPoint(positionA.x, positionA.y);
        var pointB   = new PathFinderPoint(positionB.x, positionB.y);
        var pathData = PathFinderUtil.FindPath(pointA, pointB);

        foreach (var path in pathData.path)
        {
            SetTileValue((int)path.x, (int)path.z, HALL, null, "Path");
        }
    }