private void OnEnable() { // Reference the selected client client = (SimpleClient)target; // Get a reference to the serialized connection property connection = serializedObject.FindProperty("Connection"); // Load configuration data AmqpConfigurationEditor.LoadConfiguration(); // Restore the connection index var connectionNames = AmqpConfigurationEditor.GetConnectionNames(); for (var i = 0; i < connectionNames.Length; i++) { var cName = connectionNames[i]; if (connection.stringValue == cName) { index = i; break; } } lightGreen = CustomGUIUtils.GetColorBackgroundStyle(XKCDColors.LightGreen); lightRed = CustomGUIUtils.GetColorBackgroundStyle(XKCDColors.LightRed); lightYellow = CustomGUIUtils.GetColorBackgroundStyle(XKCDColors.LightYellow); }
static void Init() { Debug.Log("Init"); clients = FindObjectsOfType <SimpleClient>(); // Load configuration data AmqpConfigurationEditor.LoadConfiguration(); //Restore the connection index RestoreConfigurationIndex(); osmMapRect = new OSMMapRect(); // Prepare GUI-Styles lightGreen = CustomGUIUtils.GetColorBackgroundStyle(XKCDColors.LightGreen); lightRed = CustomGUIUtils.GetColorBackgroundStyle(XKCDColors.LightRed); lightYellow = CustomGUIUtils.GetColorBackgroundStyle(XKCDColors.LightYellow); darkgrey = CustomGUIUtils.GetColorBackgroundStyle(XKCDColors.DarkGrey); timerFontStyle.font = (Font)Resources.Load("digitalmono"); timerFontStyle.fontSize = 34; // Get existing open window or if none, make a new one: window = (SimpleClientEditorWindow)EditorWindow.GetWindow(typeof(SimpleClientEditorWindow)); window.Show(); }