public static void DrawPostProcessing() { //Post Processing Stack string ppsLabel = "Post Processing Stack v2"; string ppsText = (PostProcessingInstallation.IS_INSTALLED) ? "Installed (Package Manager)" : "Not installed"; ppsText = (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.Integrated) ? "Integrated" : ppsText; SCPE_GUI.Status ppsStatus = (PostProcessingInstallation.IS_INSTALLED) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; ppsLabel = "Post Processing"; //Append current version if (PostProcessingInstallation.IS_INSTALLED) { ppsLabel += " (" + PostProcessingInstallation.PPS_VERSION + ")"; } //Outdated version ppsText = (PostProcessingInstallation.PPSVersionStatus == PostProcessingInstallation.VersionStatus.Outdated) ? "Outdated" : ppsText; ppsStatus = (PostProcessingInstallation.PPSVersionStatus == PostProcessingInstallation.VersionStatus.Outdated) ? SCPE_GUI.Status.Warning : ppsStatus; SCPE_GUI.DrawStatusBox(new GUIContent(ppsLabel, EditorGUIUtility.IconContent("Camera Gizmo").image), ppsText, ppsStatus); //Warning in 2019.3 and 2019.4 #if UNITY_2019_3_OR_NEWER && !UNITY_2020_1_OR_NEWER if (RenderPipelineInstallation.CurrentPipeline == RenderPipelineInstallation.Pipeline.URP && PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.PackageManager) { EditorGUILayout.HelpBox("Support for the Post Processing Stack with URP will no longer be possible in Unity 2020.1!", MessageType.Warning); } #endif if (RenderPipelineInstallation.CurrentPipeline == RenderPipelineInstallation.Pipeline.URP && (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.Integrated)) { EditorGUILayout.HelpBox("URP is installed, effects will use integrated post processing system", MessageType.None); } //Built-in render pipeline and LWRP require PPS if (PostProcessingInstallation.IS_INSTALLED == false && RenderPipelineInstallation.CurrentPipeline != RenderPipelineInstallation.Pipeline.URP) { using (new EditorGUILayout.HorizontalScope()) { if (SCPE_GUI.DrawActionBox("Install " + PostProcessingInstallation.LATEST_COMPATIBLE_VERSION, EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { PostProcessingInstallation.InstallPackage(); } } } //End if-installed //When installed but outdated else { using (new EditorGUILayout.HorizontalScope()) { if (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.PackageManager && PostProcessingInstallation.PPSVersionStatus == PostProcessingInstallation.VersionStatus.Outdated) { if (SCPE_GUI.DrawActionBox("Update to " + PostProcessingInstallation.LATEST_COMPATIBLE_VERSION, EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { PostProcessingInstallation.InstallPackage(); } } } } }
public static void DrawPackageVersion() { string versionText; SCPE_GUI.Status versionStatus; if (PackageVersionCheck.queryStatus == PackageVersionCheck.QueryStatus.Fetching) { versionStatus = SCPE_GUI.Status.Warning; versionText = "Checking update server..."; } else { versionStatus = (PackageVersionCheck.IS_UPDATED) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Warning; versionText = (PackageVersionCheck.IS_UPDATED) ? "Latest version" : "New version available"; } SCPE_GUI.DrawStatusBox(new GUIContent("Package version " + SCPE.INSTALLED_VERSION, EditorGUIUtility.IconContent("cs Script Icon").image), versionText, versionStatus); if (!PackageVersionCheck.IS_UPDATED) { using (new EditorGUILayout.HorizontalScope()) { if (SCPE_GUI.DrawActionBox("Update to " + PackageVersionCheck.fetchedVersionString, EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { SCPE.OpenStorePage(); } } } }
public static void DrawPipeline() { string pipelineText = string.Empty; string pipelineName = "Built-in Render pipeline"; SCPE_GUI.Status compatibilityStatus = SCPE_GUI.Status.Info; switch (RenderPipelineInstallation.CurrentPipeline) { case RenderPipelineInstallation.Pipeline.BuiltIn: pipelineName = "Built-in Render pipeline"; break; case RenderPipelineInstallation.Pipeline.LWRP: pipelineName = "Lightweight Render Pipeline " + RenderPipelineInstallation.SRP_VERSION; break; case RenderPipelineInstallation.Pipeline.URP: pipelineName = "URP " + RenderPipelineInstallation.SRP_VERSION; break; case RenderPipelineInstallation.Pipeline.HDRP: pipelineName = "HDRP " + RenderPipelineInstallation.SRP_VERSION; break; } if (RenderPipelineInstallation.VersionStatus == RenderPipelineInstallation.Version.Compatible) { pipelineText = "Compatible"; compatibilityStatus = SCPE_GUI.Status.Ok; } if (RenderPipelineInstallation.VersionStatus == RenderPipelineInstallation.Version.Outdated) { pipelineText = "Outdated (Requires " + RenderPipelineInstallation.MIN_URP_VERSION + ")"; compatibilityStatus = Status.Error; } if (RenderPipelineInstallation.VersionStatus == RenderPipelineInstallation.Version.Incompatible) { pipelineText = "Unsupported"; compatibilityStatus = SCPE_GUI.Status.Error; } SCPE_GUI.DrawStatusBox(new GUIContent(pipelineName, EditorGUIUtility.IconContent("d_Profiler.Rendering").image), pipelineText, compatibilityStatus); if (RenderPipelineInstallation.VersionStatus == RenderPipelineInstallation.Version.Outdated) { using (new EditorGUILayout.HorizontalScope()) { if (SCPE_GUI.DrawActionBox("Update to " + RenderPipelineInstallation.LATEST_COMPATIBLE_VERSION, EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { RenderPipelineInstallation.UpdateToLatest(); } } } }
public static void DrawPostProcessing() { //Post Processing Stack string ppsLabel = "Post Processing Stack v2"; string ppsText = (PostProcessingInstallation.IS_INSTALLED) ? (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub) ? "Installed (GitHub)" : "Installed (Package Manager)" : "Not installed"; SCPE_GUI.Status ppsStatus = (PostProcessingInstallation.IS_INSTALLED) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; #if PACKAGE_MANAGER ppsLabel = "Post Processing"; //Append current version if (PostProcessingInstallation.IS_INSTALLED) { ppsLabel += " (" + PostProcessingInstallation.PPS_VERSION + ")"; } //Outdated version ppsText = (PostProcessingInstallation.PPSVersionStatus == PostProcessingInstallation.Version.Outdated) ? "Outdated" : ppsText; ppsStatus = (PostProcessingInstallation.PPSVersionStatus == PostProcessingInstallation.Version.Outdated) ? SCPE_GUI.Status.Warning : ppsStatus; #endif SCPE_GUI.DrawStatusBox(new GUIContent(ppsLabel, EditorGUIUtility.IconContent("Camera Gizmo").image), ppsText, ppsStatus); if (PostProcessingInstallation.IS_INSTALLED == false) { #if PACKAGE_MANAGER PostProcessingInstallation.Config = PostProcessingInstallation.Configuration.PackageManager; /* v1, no longer supporting GitHub installation in 2018.1+ * using (new EditorGUILayout.HorizontalScope()) * { * EditorGUILayout.LabelField(" Installation source", EditorStyles.label); * * if (GUILayout.Button(new GUIContent("GitHub"), PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub ? SCPE_GUI.ToggleButtonLeftToggled : SCPE_GUI.ToggleButtonLeftNormal)) * { * PostProcessingInstallation.Config = PostProcessingInstallation.Configuration.GitHub; * } * if (GUILayout.Button(new GUIContent("Package Manager"), PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.PackageManager ? SCPE_GUI.ToggleButtonRightToggled : SCPE_GUI.ToggleButtonRightNormal)) * { * PostProcessingInstallation.Config = PostProcessingInstallation.Configuration.PackageManager; * } * } */ #else PostProcessingInstallation.Config = PostProcessingInstallation.Configuration.GitHub; #endif using (new EditorGUILayout.HorizontalScope()) { if (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub) { if (SCPE_GUI.DrawActionBox(string.IsNullOrEmpty(PostProcessingInstallation.PACKAGE_PATH) ? "Download" : "Install", EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { //Download if (PostProcessingInstallation.PACKAGE_PATH.Contains(".unitypackage") == false) { //Open browser and start download Application.OpenURL(PostProcessingInstallation.PP_DOWNLOAD_URL); //While the editor is minimized at this point, prompt the file browser if (EditorUtility.DisplayDialog("Post Processing Stack download", "Once the file has been downloaded, locate the file path and install it", "Browse")) { PostProcessingInstallation.PACKAGE_PATH = EditorUtility.OpenFilePanel("Package download location", "", "unitypackage"); } } //Install else { PostProcessingInstallation.InstallPackage(); } } } else { if (SCPE_GUI.DrawActionBox("Install " + PostProcessingInstallation.LATEST_COMPATIBLE_VERSION, EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { PostProcessingInstallation.InstallPackage(); } } } EditorGUILayout.Space(); if (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub) { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(new GUIContent(" Package location", EditorGUIUtility.IconContent("d_UnityLogo").image)); EditorGUILayout.TextField(PostProcessingInstallation.PACKAGE_PATH, SCPE_GUI.PathField, GUILayout.MaxWidth(180f)); if (GUILayout.Button("...", GUILayout.MaxWidth(30f))) { PostProcessingInstallation.PACKAGE_PATH = EditorUtility.OpenFilePanel("Package download location", "", "unitypackage"); } } } else { } } //End if-installed //When installed but outdated else { using (new EditorGUILayout.HorizontalScope()) { if (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.PackageManager && PostProcessingInstallation.PPSVersionStatus == PostProcessingInstallation.Version.Outdated) { if (SCPE_GUI.DrawActionBox("Update to " + PostProcessingInstallation.LATEST_COMPATIBLE_VERSION, EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { PostProcessingInstallation.InstallPackage(); } } } } }
void DrawInstallation() { SetWindowHeight(350f); using (new EditorGUILayout.VerticalScope()) { EditorGUILayout.Space(); //Package Version { string versionText = null; versionText = (PackageVersionCheck.IS_UPDATED) ? "Latest version" : "New version available"; SCPE_GUI.Status versionStatus; versionStatus = (PackageVersionCheck.IS_UPDATED) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Warning; SCPE_GUI.DrawStatusBox(new GUIContent(SCPE.INSTALLED_VERSION, EditorGUIUtility.IconContent("cs Script Icon").image), versionText, versionStatus); } if (!PackageVersionCheck.IS_UPDATED) { using (new EditorGUILayout.HorizontalScope()) { if (SCPE_GUI.DrawActionBox("Update", EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { SCPE.OpenStorePage(); this.Close(); } } } //Unity Version { string versionText = null; versionText = (UnityVersionCheck.COMPATIBLE) ? "Compatible" : "Not compatible"; versionText = (UnityVersionCheck.UNTESTED) ? "Untested!" : versionText; SCPE_GUI.Status versionStatus; versionStatus = (UnityVersionCheck.COMPATIBLE) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; versionStatus = (UnityVersionCheck.UNTESTED) ? SCPE_GUI.Status.Warning : versionStatus; SCPE_GUI.DrawStatusBox(new GUIContent("Unity " + UnityVersionCheck.UnityVersion, EditorGUIUtility.IconContent("UnityLogo").image), versionText, versionStatus); } /* * //Folder * { * if (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub) * { * string folderText = (Installer.IS_CORRECT_BASE_FOLDER) ? "Correct location" : "Outside \"PostProcessing/\""; * SCPE_GUI.Status folderStatus = (Installer.IS_CORRECT_BASE_FOLDER) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; * * SCPE_GUI.DrawStatusBox(new GUIContent("SC Post Effects folder", EditorGUIUtility.IconContent("FolderEmpty Icon").image), folderText, folderStatus); * * if (!Installer.IS_CORRECT_BASE_FOLDER) * { * if (!Installer.IS_CORRECT_BASE_FOLDER) * { * EditorGUILayout.HelpBox("Please move the SC Post Effects folder to where you've installed the Post Processing Stack", MessageType.Error); * } * } * } * * } */ //Color space { string colorText = (UnityEditor.PlayerSettings.colorSpace == ColorSpace.Linear) ? "Linear" : "Linear is recommended"; SCPE_GUI.Status folderStatus = (UnityEditor.PlayerSettings.colorSpace == ColorSpace.Linear) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Warning; SCPE_GUI.DrawStatusBox(new GUIContent("Color space", EditorGUIUtility.IconContent("d_PreTextureRGB").image), colorText, folderStatus); } //Post Processing Stack string ppsText = (PostProcessingInstallation.IS_INSTALLED) ? (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub) ? "Installed (GitHub)" : "Installed (Package Manager)" : "Not installed"; SCPE_GUI.Status ppsStatus = (PostProcessingInstallation.IS_INSTALLED) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; string ppsLabel = "Post Processing Stack v2"; #if PACKAGE_MANAGER ppsLabel = "Post Processing"; #endif SCPE_GUI.DrawStatusBox(new GUIContent(ppsLabel, EditorGUIUtility.IconContent("Camera Gizmo").image), ppsText, ppsStatus); /* * using (new EditorGUILayout.HorizontalScope(EditorStyles.label)) * { * EditorGUILayout.LabelField("Change shader configuration", EditorStyles.label); * * if (GUILayout.Button(new GUIContent("GitHub"), SCPE_GUI.ToggleButtonLeftNormal)) * { * Installer.ConfigureShaderPaths(PostProcessingInstallation.Configuration.GitHub); * } * if (GUILayout.Button(new GUIContent("Package Manager"), SCPE_GUI.ToggleButtonRightNormal)) * { * Installer.ConfigureShaderPaths(PostProcessingInstallation.Configuration.PackageManager); * } * } */ } }
private void StartScreen() { EditorGUILayout.HelpBox("\nThis wizard will guide you through the installation of the SC Post Effects package\n\nPress \"Next\" to continue...\n", MessageType.Info); EditorGUILayout.Space(); EditorGUILayout.LabelField("Pre-install checks", SCPE_GUI.Header); EditorGUILayout.Space(); using (new EditorGUILayout.VerticalScope(EditorStyles.textArea)) { EditorGUILayout.Space(); //Package Version { string versionText = null; versionText = (PackageVersionCheck.IS_UPDATED) ? "Latest version" : "New version available"; SCPE_GUI.Status versionStatus; versionStatus = (PackageVersionCheck.IS_UPDATED) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Warning; SCPE_GUI.DrawStatusBox(new GUIContent(SCPE.INSTALLED_VERSION, EditorGUIUtility.IconContent("cs Script Icon").image), versionText, versionStatus); } if (!PackageVersionCheck.IS_UPDATED) { using (new EditorGUILayout.HorizontalScope()) { if (SCPE_GUI.DrawActionBox("Update", EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { SCPE.OpenStorePage(); } } } //Unity Version { string versionText = null; versionText = (UnityVersionCheck.COMPATIBLE) ? "Compatible" : "Not compatible"; versionText = (UnityVersionCheck.UNTESTED) ? "Untested!" : versionText; SCPE_GUI.Status versionStatus; versionStatus = (UnityVersionCheck.COMPATIBLE) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; versionStatus = (UnityVersionCheck.UNTESTED) ? SCPE_GUI.Status.Warning : versionStatus; SCPE_GUI.DrawStatusBox(new GUIContent("Unity " + UnityVersionCheck.UnityVersion, EditorGUIUtility.IconContent("UnityLogo").image), versionText, versionStatus); } //Folder /* * { #if !PACKAGE_MANAGER * string folderText = (Installer.IS_CORRECT_BASE_FOLDER) ? "Correct location" : "Outside \"PostProcessing/\""; * SCPE_GUI.Status folderStatus = (Installer.IS_CORRECT_BASE_FOLDER) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; * * SCPE_GUI.DrawStatusBox(new GUIContent("SC Post Effects folder", EditorGUIUtility.IconContent("FolderEmpty Icon").image), folderText, folderStatus); * * if (!Installer.IS_CORRECT_BASE_FOLDER && (PostProcessingInstallation.IS_INSTALLED)) * { * EditorGUILayout.HelpBox("Please move the SC Post Effects folder to where you've installed the Post Processing Stack", MessageType.Error); * } #endif * } */ //Color space { string colorText = (UnityEditor.PlayerSettings.colorSpace == ColorSpace.Linear) ? "Linear" : "Linear is recommended"; SCPE_GUI.Status folderStatus = (UnityEditor.PlayerSettings.colorSpace == ColorSpace.Linear) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Warning; SCPE_GUI.DrawStatusBox(new GUIContent("Color space", EditorGUIUtility.IconContent("d_PreTextureRGB").image), colorText, folderStatus); } //Post Processing Stack string ppsText = (PostProcessingInstallation.IS_INSTALLED) ? (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub) ? "Installed (GitHub)" : "Installed (Package Manager)" : "Not installed"; SCPE_GUI.Status ppsStatus = (PostProcessingInstallation.IS_INSTALLED) ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; string ppsLabel = "Post Processing Stack v2"; #if PACKAGE_MANAGER ppsLabel = "Post Processing"; #endif SCPE_GUI.DrawStatusBox(new GUIContent(ppsLabel, EditorGUIUtility.IconContent("Camera Gizmo").image), ppsText, ppsStatus); if (PostProcessingInstallation.IS_INSTALLED == false) { #if PACKAGE_MANAGER using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(" Installation source", EditorStyles.label); if (GUILayout.Button(new GUIContent("GitHub"), PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub ? SCPE_GUI.ToggleButtonLeftToggled : SCPE_GUI.ToggleButtonLeftNormal)) { PostProcessingInstallation.Config = PostProcessingInstallation.Configuration.GitHub; } if (GUILayout.Button(new GUIContent("Package Manager"), PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.PackageManager ? SCPE_GUI.ToggleButtonRightToggled : SCPE_GUI.ToggleButtonRightNormal)) { PostProcessingInstallation.Config = PostProcessingInstallation.Configuration.PackageManager; } } #else PostProcessingInstallation.Config = PostProcessingInstallation.Configuration.GitHub; #endif using (new EditorGUILayout.HorizontalScope()) { if (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub) { if (SCPE_GUI.DrawActionBox(string.IsNullOrEmpty(PostProcessingInstallation.PACKAGE_PATH) ? "Download" : "Install", EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { //Download if (PostProcessingInstallation.PACKAGE_PATH.Contains(".unitypackage") == false) { Application.OpenURL(PostProcessingInstallation.PP_DOWNLOAD_URL); if (EditorUtility.DisplayDialog("Post Processing Stack download", "Once the file has been downloaded, locate the file path and install it", "Browse")) { PostProcessingInstallation.PACKAGE_PATH = EditorUtility.OpenFilePanel("Package download location", "", "unitypackage"); } } //Install else { PostProcessingInstallation.InstallPackage(); } } } else { if (SCPE_GUI.DrawActionBox("Install", EditorGUIUtility.IconContent("BuildSettings.Standalone.Small").image)) { PostProcessingInstallation.InstallPackage(); } } } EditorGUILayout.Space(); if (PostProcessingInstallation.Config == PostProcessingInstallation.Configuration.GitHub) { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(new GUIContent(" Package location", EditorGUIUtility.IconContent("d_UnityLogo").image)); EditorGUILayout.TextField(PostProcessingInstallation.PACKAGE_PATH, SCPE_GUI.PathField, GUILayout.MaxWidth(180f)); if (GUILayout.Button("...", GUILayout.MaxWidth(30f))) { PostProcessingInstallation.PACKAGE_PATH = EditorUtility.OpenFilePanel("Package download location", "", "unitypackage"); } } } else { } } //End if-installed EditorGUILayout.Space(); } //Validate for errors before allowing to continue hasError = !UnityVersionCheck.COMPATIBLE; //hasError = !Installer.IS_CORRECT_BASE_FOLDER; hasError = (PostProcessingInstallation.IS_INSTALLED == false); }