Function GridNodeBase.ContainsOutgoingConnection

ContainsOutgoingConnection (GraphNode node)

True if this node contains a connection to the given node.

Public
bool ContainsOutgoingConnection (

GraphNode

node

)

True if this node contains a connection to the given node.

This will not return true if another node has a one-way connection to this node.

AstarPath.active.AddWorkItem(new AstarWorkItem(ctx => {
// Connect two nodes
var node1 = AstarPath.active.GetNearest(transform.position, NNConstraint.None).node;
var node2 = AstarPath.active.GetNearest(transform.position + Vector3.right, NNConstraint.None).node;
var cost = (uint)(node2.position - node1.position).costMagnitude;
node1.AddPartialConnection(node2, cost, true, true);
node2.AddPartialConnection(node1, cost, true, true);

node1.ContainsOutgoingConnection(node2); // True

node1.RemovePartialConnection(node2);
node2.RemovePartialConnection(node1);
}));