mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +08:00
Exposed virtual OnGUI() and 'position' for graph editors
This commit is contained in:
parent
ba8b9ef447
commit
bab898e489
@ -14,6 +14,7 @@ namespace XNodeEditor {
|
||||
Matrix4x4 m = GUI.matrix;
|
||||
if (graph == null) return;
|
||||
graphEditor = NodeGraphEditor.GetEditor(graph);
|
||||
graphEditor.position = position;
|
||||
|
||||
Controls();
|
||||
|
||||
@ -23,6 +24,7 @@ namespace XNodeEditor {
|
||||
DrawNodes();
|
||||
DrawSelectionBox();
|
||||
DrawTooltip();
|
||||
graphEditor.OnGUI();
|
||||
|
||||
GUI.matrix = m;
|
||||
}
|
||||
|
||||
@ -8,8 +8,13 @@ namespace XNodeEditor {
|
||||
/// <summary> Base class to derive custom Node Graph editors from. Use this to override how graphs are drawn in the editor. </summary>
|
||||
[CustomNodeGraphEditor(typeof(XNode.NodeGraph))]
|
||||
public class NodeGraphEditor : XNodeEditor.Internal.NodeEditorBase<NodeGraphEditor, NodeGraphEditor.CustomNodeGraphEditorAttribute, XNode.NodeGraph> {
|
||||
/// <summary> The position of the window in screen space. </summary>
|
||||
public Rect position;
|
||||
/// <summary> Are we currently renaming a node? </summary>
|
||||
protected bool isRenaming;
|
||||
|
||||
public virtual void OnGUI() { }
|
||||
|
||||
public virtual Texture2D GetGridTexture() {
|
||||
return NodeEditorPreferences.GetSettings().gridTexture;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user