mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
Renamed some methods
This commit is contained in:
parent
90392de94c
commit
94b9318858
@ -6,8 +6,8 @@ using UnityEditor;
|
|||||||
[CustomNodeEditor(typeof(DisplayValue), "Display Value")]
|
[CustomNodeEditor(typeof(DisplayValue), "Display Value")]
|
||||||
public class DisplayValueEditor : NodeEditor {
|
public class DisplayValueEditor : NodeEditor {
|
||||||
|
|
||||||
public override void OnNodeGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
protected override void OnBodyGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
||||||
base.OnNodeGUI(out portPositions);
|
base.OnBodyGUI(out portPositions);
|
||||||
EditorGUILayout.LabelField("Value: " + GetResult());
|
EditorGUILayout.LabelField("Value: " + GetResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
[CustomNodeEditor(typeof(MathNode), "Math")]
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
[CustomNodeEditor(typeof(MathNode), "Math")]
|
|
||||||
public class AddNodeEditor : NodeEditor {
|
public class AddNodeEditor : NodeEditor {
|
||||||
|
|
||||||
public override void OnNodeGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
|
||||||
base.OnNodeGUI(out portPositions);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,19 +13,19 @@ public class NodeEditor {
|
|||||||
|
|
||||||
/// <summary> Draws the node GUI.</summary>
|
/// <summary> Draws the node GUI.</summary>
|
||||||
/// <param name="portPositions">Port handle positions need to be returned to the NodeEditorWindow </param>
|
/// <param name="portPositions">Port handle positions need to be returned to the NodeEditorWindow </param>
|
||||||
public virtual void OnNodeGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
public void OnNodeGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
||||||
DrawDefaultHeaderGUI();
|
OnHeaderGUI();
|
||||||
DrawDefaultNodeBodyGUI(out portPositions);
|
OnBodyGUI(out portPositions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void DrawDefaultHeaderGUI() {
|
protected virtual void OnHeaderGUI() {
|
||||||
GUI.color = Color.white;
|
GUI.color = Color.white;
|
||||||
string title = NodeEditorUtilities.PrettifyCamelCase(target.name);
|
string title = NodeEditorUtilities.PrettifyCamelCase(target.name);
|
||||||
GUILayout.Label(title, NodeEditorResources.styles.nodeHeader, GUILayout.Height(30));
|
GUILayout.Label(title, NodeEditorResources.styles.nodeHeader, GUILayout.Height(30));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Draws standard field editors for all public fields </summary>
|
/// <summary> Draws standard field editors for all public fields </summary>
|
||||||
protected void DrawDefaultNodeBodyGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
protected virtual void OnBodyGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
||||||
portPositions = new Dictionary<NodePort, Vector2>();
|
portPositions = new Dictionary<NodePort, Vector2>();
|
||||||
|
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user