//Traverse and process all nodes in a topological order,dependency of the node is already resolved.if you want to run specific node,you can use RunNodeDependently instead
publicvoidDirectlyTraversal(){
foreach(varnodeinTopologicalOrder){
varlinks=node.InputLink;
foreach(varlinkinlinks){
HandlingLink(link);
}
node.NodeData.Process();
}
}
/// <summary>
/// Cache out port data in the graph tool so that we can directly access the output.
/// The two function assume there will be no change happens in scene nodes or blackboard referenced data during the running,so in a dependency traversal for some
/// batch of nodes.the nodes could directly access the output data in the graph tool instead of waiting dependency traversal resolve the result of the output.
/// </summary>
publicvoidStartCachingPort(){
_isCachingOutput=true;
}
publicvoidEndCachingPort(){
_isCachingOutput=false;
OutputCached.Clear();
}
/// <summary>
/// Resolve dependencies by a deep first search,the depended nodes will be processed to satisfy the need of the the given runtime node
/// Note it's a recursive function.if you want directly traverse all nodes with dependency resolved ,use DirectlyTraversal() instead.
/// </summary>
/// <param name="runtimeNode">The node you want to resolve dependency</param>
/// <param name="dependencyLevel">search depth,no need provide a number when use outside</param>
//Traverse and process all nodes in a topological order,dependency of the node is already resolved.if you want to run specific node,you can use RunNodeDependently instead
publicvoidDirectlyTraversal(){
foreach(varnodeinTopologicalOrder){
varlinks=node.InputLink;
foreach(varlinkinlinks){
HandlingLink(link);
}
node.NodeData.Process();
}
}
/// <summary>
/// Cache out port data in the graph tool so that we can directly access the output.
/// The two function assume there will be no change happens in scene nodes or blackboard referenced data during the running,so in a dependency traversal for some
/// batch of nodes.the nodes could directly access the output data in the graph tool instead of waiting dependency traversal resolve the result of the output.
/// </summary>
publicvoidStartCachingPort(){
_isCachingOutput=true;
}
publicvoidEndCachingPort(){
_isCachingOutput=false;
OutputCached.Clear();
}
/// <summary>
/// Resolve dependencies by a deep first search,the depended nodes will be processed to satisfy the need of the the given runtime node
/// Note it's a recursive function.if you want directly traverse all nodes with dependency resolved ,use DirectlyTraversal() instead.
/// </summary>
/// <param name="runtimeNode">The node you want to resolve dependency</param>
/// <param name="dependencyLevel">search depth,no need provide a number when use outside</param>