book_4_sparkGenerated
code_blocksInput

Description

The Matches method in the NodeQuery struct is used to determine if a given path matches the criteria defined by the NodeQuery instance. This method is particularly useful in scenarios where you need to filter or identify specific nodes within a node editor based on a path structure.

Usage

To use the Matches method, you need to have an instance of NodeQuery and a path represented as a IReadOnlyList<Editor.Menu.PathElement>. Call the method with the path as the argument to check if it matches the query criteria.

Example

// Example usage of the Matches method
var nodeQuery = new Editor.NodeEditor.NodeQuery();
var path = new List<Editor.Menu.PathElement>
{
    new Editor.Menu.PathElement("Node1"),
    new Editor.Menu.PathElement("Node2")
};

bool isMatch = nodeQuery.Matches(path);
if (isMatch)
{
    // The path matches the query criteria
    // Perform actions based on the match
}