docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method DepthFirstSearchForAllPaths

    DepthFirstSearchForAllPaths(T, T)

    Finds all paths between a start and end node using DFS.

    Declaration
    public List<List<T>> DepthFirstSearchForAllPaths(T startNode, T endNode)
    Parameters
    Type Name Description
    T startNode

    The node to start from.

    T endNode

    The node to end at.

    Returns
    Type Description
    List<List<T>>

    A list of paths between the nodes.

    DepthFirstSearchForAllPaths(T, Predicate<T>)

    Finds all paths from a start node to nodes matching a condition.

    Declaration
    public List<List<T>> DepthFirstSearchForAllPaths(T startNode, Predicate<T> endNodeCondition)
    Parameters
    Type Name Description
    T startNode

    The node to start from.

    Predicate<T> endNodeCondition

    Predicate identifying acceptable end nodes.

    Returns
    Type Description
    List<List<T>>

    A list of matching paths.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)