private void SdkRow(SdkInfo info, Func <bool, bool> customButton = null) { var lat = info.LatestVersion; var cur = info.CurrentVersion; var isInst = !string.IsNullOrEmpty(cur); var canInst = !string.IsNullOrEmpty(lat) && (!isInst || MoPub.CompareVersions(cur, lat) < 0); // Is any async job in progress? var stillWorking = coroutine != null || downloader != null; string tooltip = string.Empty; if (isInst && (MoPub.CompareVersions(cur, lat) != 0 || testing)) { tooltip += "\n Installed: " + cur; } if (info.NetworkVersions != null) { string version; if (info.NetworkVersions.TryGetValue(PackageConfig.Platform.ANDROID, out version)) { tooltip += "\n Android SDK: " + version; } if (info.NetworkVersions.TryGetValue(PackageConfig.Platform.IOS, out version)) { tooltip += "\n iOS SDK: " + version; } } if (!string.IsNullOrEmpty(tooltip)) { tooltip = info.Name + "\n Package: " + (lat ?? "n/a") + tooltip; } GUILayout.Space(4); using (new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(false))) { GUILayout.Space(10); EditorGUILayout.LabelField(new GUIContent { text = info.Name, tooltip = tooltip }); GUILayout.Button(new GUIContent { text = lat ?? "--", tooltip = tooltip }, canInst ? EditorStyles.boldLabel : EditorStyles.label); GUILayout.Space(3); if (customButton == null || !customButton(canInst)) { GUI.enabled = !stillWorking && (canInst || testing); if (GUILayout.Button(new GUIContent { text = isInst ? "Upgrade" : "Install", tooltip = tooltip }, fieldWidth)) { this.StartCoroutine(DownloadSDK(info)); } GUI.enabled = true; } if (!string.IsNullOrEmpty(info.Instructions) && (info.Instructions != helpLink || testing)) { if (GUILayout.Button("?", GUILayout.ExpandWidth(false))) { Application.OpenURL(info.Instructions); } } else { // Need to fill space so that the Install/Upgrade buttons all line up nicely. GUILayout.Button(" ", EditorStyles.label, GUILayout.Width(17)); } GUILayout.Space(5); } GUILayout.Space(4); }