public static FloatField ( GUIContent label, float value, object callingObj ) : float | ||
label | GUIContent | |
value | float | |
callingObj | object | |
Результат | float |
public override void NodeGUI() { value = GUIExt.FloatField(new GUIContent("Value", "The input value of type float"), value); OutputKnob(0); if (GUI.changed) { NodeEditor.RecalculateFrom(this); } }
public override void NodeGUI() { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); if (Inputs [0].connection != null) { GUILayout.Label(Inputs [0].name); } else { Input1Val = GUIExt.FloatField(GUIContent.none, Input1Val); } InputKnob(0); // -- if (Inputs [1].connection != null) { GUILayout.Label(Inputs [1].name); } else { Input2Val = GUIExt.FloatField(GUIContent.none, Input2Val); } InputKnob(1); GUILayout.EndVertical(); GUILayout.BeginVertical(); Outputs [0].DisplayLayout(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); #if UNITY_EDITOR type = (CalcType)UnityEditor.EditorGUILayout.EnumPopup(new GUIContent("Calculation Type", "The type of calculation performed on Input 1 and Input 2"), type); #else GUILayout.Label(new GUIContent("Calculation Type: " + type.ToString(), "The type of calculation performed on Input 1 and Input 2")); #endif if (GUI.changed) { NodeEditor.RecalculateFrom(this); } }