While making a new graph type, I wanted to add a Node on startup (a blackboard, that I am porting from my own Node editor) but it appears none of the code in the editor is being called.
This is my editor code, note that the file is in a folder named Editor.
`
[CustomNodeGraphEditor(typeof(BlackBoardGraph))]
public abstract class BlackboardGraphEditor : NodeGraphEditor {
public override void OnGUI() {
base.OnGUI();
Debug.Log("test");
}
public override void RemoveNode(Node node) {
if (node.GetType() == typeof(Blackboard)) {
return;
}
base.RemoveNode(node);
}
public override void OnCreate() {
if (target.nodes.Where(node => node.GetType() == typeof(Blackboard)).First() == null) {
CreateNode(typeof(Blackboard), new Vector2(0, 0));
Debug.Log("create");
} else {
Debug.Log("should already have");
}
}
}`
Blackboardgraph is just a type that extends NodeGraph.
Not sure why this doesn't work, I've tried looking at the attribute code, but have no idea how it works. None of the Debugs are printing in the console, and the Node isn't being added to be specific.
While making a new graph type, I wanted to add a Node on startup (a blackboard, that I am porting from my own Node editor) but it appears none of the code in the editor is being called. This is my editor code, note that the file is in a folder named Editor. `
Blackboardgraph is just a type that extends NodeGraph.
Not sure why this doesn't work, I've tried looking at the attribute code, but have no idea how it works. None of the Debugs are printing in the console, and the Node isn't being added to be specific.