/// <summary> /// Shows the window. /// </summary> public static void ShowWindow(string description, string[] signals, Action <string[]> callback) { Instance = DisplayWizard <InternalSignalsList>("Select Signals"); Instance.OnChange = callback; Instance.SetDescription(description); Instance.SetSelectedSignals(signals); }
public static void ButtonSignals(string caption, string description, string[] signals, Action <string[]> callback, float offsetLeft = 0) { string title = ""; if (signals == null || signals.Length == 0) { title = "None"; } else if (signals.Length == 1) { title = InternalUtilities.GetSignalName(signals[0]); } else { title = InternalUtilities.GetSignalName(signals[0]) + ", ..."; } var rect = EditorGUILayout.GetControlRect(false, 16f); rect = EditorGUI.PrefixLabel(rect, new GUIContent(caption)); rect.x -= offsetLeft; rect.width += offsetLeft; EditorGUI.BeginChangeCheck(); GUI.Button(rect, new GUIContent(title)); if (EditorGUI.EndChangeCheck()) { InternalSignalsList.ShowWindow ( description, signals, callback ); } }