public override void NodeGUI() { GUILayout.BeginHorizontal(); GUILayout.Label("Pass: "******"Fail: "); outputFail.DrawKnob(); GUILayout.EndHorizontal(); GUILayout.Label("Variable type:"); if (GUILayout.Button(variableTypes[variableType])) { typePopup = new PopupMenu(); typePopup.SetupGUI(); for (int i = 0; i < variableTypes.Length; i++) { typePopup.AddItem(new GUIContent(variableTypes[i]), false, SelectType, i); } typePopup.Show(GUIScaleUtility.GUIToScreenSpace(GUILayoutUtility.GetLastRect().max)); } //variableType = GUILayout.SelectionGrid(variableType, variableTypes, 1, GUILayout.Width(128f)); if (variableType <= 1 || variableType == 5) { GUILayout.Label("Variable Name:"); GUILayout.BeginHorizontal(); variableName = GUILayout.TextArea(variableName); GUILayout.EndHorizontal(); } else if (variableType == 5) { GUILayout.Label("Mission Name:"); GUILayout.BeginHorizontal(); variableName = GUILayout.TextArea(variableName); GUILayout.EndHorizontal(); } if (variableName.Equals(checkpointName, System.StringComparison.CurrentCulture)) { checkpointName = ""; } if (checkpointName != "") { GUILayout.Label("<color=red>Deprecated data detected! Checkpoint name = '" + checkpointName + "'</color>\n"); } if (variableType > 0) { if (variableType != 5) { GUILayout.Label("Value:"); value = RTEditorGUI.IntField(value); } GUILayout.Label("Comparison mode:"); //comparisonMode = GUILayout.SelectionGrid(comparisonMode, comparisonModes, 1, GUILayout.Width(128f)); string[] comparisonTexts = variableType == 5 ? missionStatus : comparisonModes; if (GUILayout.Button(comparisonTexts[comparisonMode])) { comparisonPopup = new PopupMenu(); comparisonPopup.SetupGUI(); for (int i = 0; i < comparisonTexts.Length; i++) { comparisonPopup.AddItem(new GUIContent(comparisonTexts[i]), false, SelectMode, i); } comparisonPopup.Show(GUIScaleUtility.GUIToScreenSpace(GUILayoutUtility.GetLastRect().max)); } } }
public override void NodeGUI() { if (input == null) { InitConnectionKnobs(); } GUILayout.BeginHorizontal(); GUILayout.Label("Pass: "******"Fail: "); outputFail.DrawKnob(); GUILayout.EndHorizontal(); GUILayout.Label("Variable type:"); if (GUILayout.Button(variableTypes[variableType])) { typePopup = new PopupMenu(); typePopup.SetupGUI(); for (int i = 0; i < variableTypes.Length; i++) { typePopup.AddItem(new GUIContent(variableTypes[i]), false, SelectType, i); } typePopup.Show(GUIScaleUtility.GUIToScreenSpace(GUILayoutUtility.GetLastRect().max)); } if (variableType <= 1 || variableType == 5) { GUILayout.Label("Variable Name:"); GUILayout.BeginHorizontal(); variableName = GUILayout.TextArea(variableName); GUILayout.EndHorizontal(); } else if (variableType == 5) { GUILayout.Label("Mission Name:"); GUILayout.BeginHorizontal(); variableName = GUILayout.TextArea(variableName); GUILayout.EndHorizontal(); } if (variableType > 0) { if (variableType != 5) { GUILayout.Label("Value:"); value = RTEditorGUI.IntField(value); } GUILayout.Label("Comparison mode:"); string[] comparisonTexts = variableType == 5 ? missionStatus : comparisonModes; if (GUILayout.Button(comparisonTexts[comparisonMode])) { comparisonPopup = new PopupMenu(); comparisonPopup.SetupGUI(); for (int i = 0; i < comparisonTexts.Length; i++) { comparisonPopup.AddItem(new GUIContent(comparisonTexts[i]), false, SelectMode, i); } comparisonPopup.Show(GUIScaleUtility.GUIToScreenSpace(GUILayoutUtility.GetLastRect().max)); } } }