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

Commit 35e90fd

Browse files
author
Levin G
committed
Merge pull request #48 from ScriptGeek/master
Added optional node property editor to side window of NodeEditorWindow
2 parents 79aa796 + 38d20a8 commit 35e90fd

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Editor/Node_Editor/NodeEditorWindow.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ 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+
if (Event.current.type != EventType.Ignore)
203+
mainEditorState.selectedNode.DrawNodePropertyEditor();
204+
}
201205

202206
#endregion
203207

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)