Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 093dec7

Browse files
committed
Added optional custom node property editor to side window of NodeEditorWindow
1 parent 79aa796 commit 093dec7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Editor/Node_Editor/NodeEditorWindow.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ private void DrawSideWindow ()
197197

198198
NodeEditorGUI.knobSize = EditorGUILayout.IntSlider (new GUIContent ("Handle Size", "The size of the Node Input/Output handles"), NodeEditorGUI.knobSize, 12, 20);
199199
mainEditorState.zoom = EditorGUILayout.Slider (new GUIContent ("Zoom", "Use the Mousewheel. Seriously."), mainEditorState.zoom, 0.6f, 2);
200-
}
200+
201+
if (mainEditorState.selectedNode != null)
202+
mainEditorState.selectedNode.DrawNodePropertyEditor();
203+
}
201204

202205
#endregion
203206

Node_Editor/Framework/Node.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ public void DrawTransitions ()
286286
}
287287
}
288288

289+
/// <summary>
290+
/// Used to display a custom node property editor in the side window of the NodeEditorWindow
291+
/// Optionally override this to implement
292+
/// </summary>
293+
public virtual void DrawNodePropertyEditor() { }
294+
289295
#endregion
290296

291297
#region Node Calculation Utility

0 commit comments

Comments
 (0)