Skip to content
Thor Brigsted edited this page Jun 15, 2018 · 12 revisions

Your NodeGraph's main purpose is containing your nodes. Nodes are accessible through the nodes variable, and looping through it is your main entrance point to your graph.

[CreateAssetMenu]
public class SimpleGraph : NodeGraph { 

  public RootNode GetRootNode() {
    for (int i = 0; i < nodes.Count; i++) {
      if (nodes[i] as NewNode) return nodes[i] as NewNode;
    }
    return null;
  }
}

Context menu

Graphs support the [ContextMenu] attribute. Simply add [ContextMenu] to a non-static method and it will show up when you right-click anywhere on the grid. Select it to execute the method. You can read more about it here

Clone this wiki locally