static void OpenByMenu() { var settings = CloudBuildSettings.LoadSettings(); if (settings == null) { CloudBuildSettingsWindow.Open(); } else { Open(); } }
void OnGUI() { if (!initialized) { Initialize(); } if (selectedConfigNames == null) { selectedConfigNames = new HashSet <string>(); } _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition); // title EditorGUILayout.LabelField("CloudBuild Launcher", EditorStyles.boldLabel); GUILayout.Space(10); // settings button if (GUILayout.Button("Open Settings...", GUILayout.MaxWidth(120))) { CloudBuildSettingsWindow.Open(); } GUILayout.Space(10); // target configs EditorGUILayout.LabelField("Target configs", EditorStyles.boldLabel); foreach (var target in settings.targetConfigs) { var enabled = GUILayout.Toggle(ConfigNameSelected(target), target); SelectConfigName(target, enabled); } GUILayout.Space(10); // config adjustment EditorGUILayout.LabelField("Config adjustment", EditorStyles.boldLabel); changeBranch = EditorGUILayout.Toggle("Change git branch", changeBranch); if (changeBranch) { EditorGUILayout.LabelField("Git branch name"); branchName = EditorGUILayout.TextField(branchName); if (string.IsNullOrEmpty(branchName)) { EditorGUILayout.LabelField("Please input a valid branch name.", styleWarningLabel); } } GUILayout.Space(20); // Launch button EditorGUI.BeginDisabledGroup(!IsInputValid()); if (GUILayout.Button("Launch!")) { AdjustAndLaunchConfigs(); } EditorGUI.EndDisabledGroup(); GUILayout.Space(10); // status text GUILayout.Label("Status:"); EditorGUILayout.SelectableLabel(status, EditorStyles.textArea, GUILayout.MaxHeight(100), GUILayout.MinHeight(20)); EditorGUILayout.EndScrollView(); }