mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
19 lines
540 B
C#
19 lines
540 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
[CustomNodeEditor(typeof(DisplayValue), "Display Value")]
|
|
public class DisplayValueEditor : NodeEditor {
|
|
|
|
public override void OnNodeGUI(out Dictionary<NodePort, Vector2> portPositions) {
|
|
base.OnNodeGUI(out portPositions);
|
|
EditorGUILayout.LabelField("Value: " + GetResult());
|
|
}
|
|
|
|
public float GetResult() {
|
|
ExampleNodeBase t = target as ExampleNodeBase;
|
|
return t.GetInputFloat("value");
|
|
}
|
|
}
|