public override void OnNodeDraw(GraphGUI host) { // Recapture the variable for the delegate. var node2 = this; // Subwindow style (active/nonactive) var isActive = host.selection.Contains(this); if (this.nodeStyle == null) { nodeStyle = new GUIStyle(UnityEditor.Graphs.Styles.GetNodeStyle(this.style, this.color, true)); nodeStyle.normal.background = Resources.Load <Texture2D> ("TxKit"); } // Show the subwindow of this node. this.position = GUILayout.Window( this.GetInstanceID(), this.position, delegate { host.NodeGUI(node2); }, "", nodeStyle, GUILayout.Width(256), GUILayout.Height(256) ); }