1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-22 10:16:02 +08:00
xNode/Example/Nodes/Editor/DisplayValueEditor.cs
2017-10-28 00:06:25 +02:00

21 lines
621 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace ExampleNodes {
[CustomNodeEditor(typeof(ExampleNodes.DisplayValue), "ExampleNodes/Display Value")]
public class DisplayValueEditor : NodeEditor {
protected override void OnBodyGUI(out Dictionary<NodePort, Vector2> portPositions) {
base.OnBodyGUI(out portPositions);
EditorGUILayout.LabelField(GetResult().ToString());
}
public float GetResult() {
DisplayValue t = target as DisplayValue;
return t.GetValue();
}
}
}