mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +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")]
|
||||
public class DisplayValueEditor : NodeEditor {
|
||||
|
||||
public override void OnNodeGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
||||
base.OnNodeGUI(out portPositions);
|
||||
protected override void OnBodyGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
||||
base.OnBodyGUI(out portPositions);
|
||||
EditorGUILayout.LabelField("Value: " + GetResult());
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CustomNodeEditor(typeof(MathNode), "Math")]
|
||||
[CustomNodeEditor(typeof(MathNode), "Math")]
|
||||
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>
|
||||
/// <param name="portPositions">Port handle positions need to be returned to the NodeEditorWindow </param>
|
||||
public virtual void OnNodeGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
||||
DrawDefaultHeaderGUI();
|
||||
DrawDefaultNodeBodyGUI(out portPositions);
|
||||
public void OnNodeGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
||||
OnHeaderGUI();
|
||||
OnBodyGUI(out portPositions);
|
||||
}
|
||||
|
||||
protected void DrawDefaultHeaderGUI() {
|
||||
protected virtual void OnHeaderGUI() {
|
||||
GUI.color = Color.white;
|
||||
string title = NodeEditorUtilities.PrettifyCamelCase(target.name);
|
||||
GUILayout.Label(title, NodeEditorResources.styles.nodeHeader, GUILayout.Height(30));
|
||||
}
|
||||
|
||||
/// <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>();
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user