void DrawInstallOption(BoltInstalls install) { BoltPackage package = packageInfo[install]; Action action = () => { if (package.installTest()) { ShowNotification(new GUIContent("Package already installed")); return; } Install(package); }; bool packageExists = PackageExists(package.name); Action ignoredAction; if (packageExists == true) { ignoredAction = () => { ShowNotification(new GUIContent("One of the dependencies is missing")); }; } else { if (install == BoltInstalls.Core) { ignoredAction = () => { ShowNotification(new GUIContent("Bolt Core is no longer required. You are ready to go.")); }; } else { ignoredAction = () => { ShowNotification(new GUIContent("Please contact us at [email protected]")); }; } EditorGUI.BeginDisabledGroup(true); } DrawStepOption(samplesIcon, new GUIContent(package.title), new GUIContent(package.description), package.installTest(), action, ignoredAction); if (packageExists == false) { EditorGUI.EndDisabledGroup(); } }
void DrawInstallOption(BoltInstalls install) { BoltPackage package = packageInfo[install]; Action action = () => { if (package.installTest()) { Debug.LogWarning("Package already installed"); return; } Install(package); }; if (PackageExists(package.name)) { DrawStepOption(samplesIcon, new GUIContent(package.title), new GUIContent(package.description), package.installTest(), action); } }