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 DrawPlatform() { string compatibilityText = SCPE.IsCompatiblePlatform ? "Compatible" : "Unsupported"; SCPE_GUI.Status compatibilityStatus = SCPE.IsCompatiblePlatform ? SCPE_GUI.Status.Ok : SCPE_GUI.Status.Error; SCPE_GUI.DrawStatusBox(TargetPlatform(), compatibilityText, compatibilityStatus); }
public static void DrawColorSpace() { 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); }
public override void OnInspectorGUI() { SCPE_GUI.DisplayDocumentationButton("radial-blur"); SCPE_GUI.DisplaySetupWarning <RadialBlurRenderer>(); PropertyField(amount); PropertyField(iterations); }
public override void OnInspectorGUI() { SCPE_GUI.DisplayDocumentationButton("black-bars"); SCPE_GUI.DisplaySetupWarning(); PropertyField(mode); PropertyField(size); PropertyField(maxSize); }
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 override void OnInspectorGUI() { SCPE_GUI.DisplayDocumentationButton("blur"); SCPE_GUI.DisplaySetupWarning <BlackBarsRenderer>(); PropertyField(mode); PropertyField(highQuality); PropertyField(amount); PropertyField(iterations); PropertyField(downscaling); }
public static void DrawUnityVersion() { 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; string tooltip = (UnityVersionCheck.COMPATIBLE) ? "Tested with the current package version" : "This version is not compatible"; tooltip = (UnityVersionCheck.UNTESTED) ? "This version has not been tested, issues may arise" : tooltip; SCPE_GUI.DrawStatusBox(new GUIContent("Unity " + UnityVersionCheck.UnityVersion, EditorGUIUtility.IconContent("UnityLogo").image, tooltip), versionText, versionStatus); }
public override void OnInspectorGUI() { SCPE_GUI.DisplayDocumentationButton("ambient-occlusion-2d"); SCPE_GUI.DisplayVRWarning(); SCPE_GUI.DisplaySetupWarning <AmbientOcclusion2DRenderer>(); PropertyField(aoOnly); PropertyField(intensity); PropertyField(luminanceThreshold); PropertyField(distance); PropertyField(blurAmount); PropertyField(iterations); PropertyField(downscaling); }
public override void OnInspectorGUI() { SCPE_GUI.DisplayDocumentationButton("lut"); SCPE_GUI.DisplaySetupWarning(); using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); if (GUILayout.Button(new GUIContent("Open LUT Extracter", EditorGUIUtility.IconContent("d_PreTextureRGB").image, "Extract a LUT from the bottom-left corner of a screenshot"), EditorStyles.miniButton, GUILayout.Height(20f), GUILayout.Width(150f))) { LUTExtracterWindow.ShowWindow(); } GUILayout.FlexibleSpace(); } EditorGUILayout.Space(); CheckLUTImportSettings(lutNear); if (mode.value.intValue == 1) { CheckLUTImportSettings(lutFar); } PropertyField(mode); PropertyField(intensity); PropertyField(lutNear, new GUIContent(mode.value.intValue == 0 ? "Look up Texture" : "Near")); if (mode.value.intValue == 1) { PropertyField(lutFar); PropertyField(distance); } PropertyField(invert); }
public static void DrawPipeline() { #if PACKAGE_MANAGER 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 = "LWRP " + 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.Incompatible) { pipelineText = "Unsupported (Requires " + RenderPipelineInstallation.MIN_SRP_VERSION + ")"; compatibilityStatus = SCPE_GUI.Status.Error; } SCPE_GUI.DrawStatusBox(new GUIContent(pipelineName, EditorGUIUtility.IconContent("d_Profiler.Rendering").image), pipelineText, compatibilityStatus); #endif }
private void InstallScreen() { EditorGUILayout.Space(); EditorGUILayout.LabelField("Options", SCPE_GUI.Header); EditorGUILayout.Space(); using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) { using (new EditorGUILayout.HorizontalScope()) { using (new EditorGUI.DisabledGroupScope(Installer.Demo.HAS_SCENE_PACKAGE == false)) { //EditorGUILayout.LabelField("Install demo content"); Installer.Settings.installDemoContent = SCPE_GUI.BoolSwitchGUI.Draw(Installer.Settings.installDemoContent, "Demo scenes"); //Installer.Settings.installDemoContent = EditorGUILayout.Toggle(Installer.Settings.installDemoContent); } //When installed if (Installer.Demo.SCENES_INSTALLED) { SCPE_GUI.DrawStatusBox(null, "Installed", SCPE_GUI.Status.Ok, false); } //Not installed and missing source if (!Installer.Demo.SCENES_INSTALLED) { if (Installer.Demo.HAS_SCENE_PACKAGE == false) { SCPE_GUI.DrawStatusBox(null, "Missing", SCPE_GUI.Status.Warning, false); } } } } using (new EditorGUILayout.HorizontalScope()) { if (Installer.Demo.HAS_SCENE_PACKAGE == true) { EditorGUILayout.LabelField("Examples showing volume blending", EditorStyles.miniLabel); } if (Installer.Demo.HAS_SCENE_PACKAGE == false && Installer.Demo.SCENES_INSTALLED == false) { EditorGUILayout.HelpBox("Also import the \"_DemoContents.unitypackage\" file to install.", MessageType.None); } } using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) { using (new EditorGUILayout.HorizontalScope()) { using (new EditorGUI.DisabledGroupScope(Installer.Demo.HAS_SAMPLES_PACKAGE == false)) { //EditorGUILayout.LabelField("Install demo content"); Installer.Settings.installSampleContent = SCPE_GUI.BoolSwitchGUI.Draw(Installer.Settings.installSampleContent, "Sample content"); if (Installer.Settings.installDemoContent) { Installer.Settings.installSampleContent = true; } //Installer.Settings.installDemoContent = EditorGUILayout.Toggle(Installer.Settings.installDemoContent); } //When installed if (Installer.Demo.SAMPLES_INSTALLED) { SCPE_GUI.DrawStatusBox(null, "Installed", SCPE_GUI.Status.Ok, false); } //Not installed and missing source if (!Installer.Demo.SAMPLES_INSTALLED) { if (Installer.Demo.HAS_SAMPLES_PACKAGE == false) { SCPE_GUI.DrawStatusBox(null, "Missing", SCPE_GUI.Status.Warning, false); } } } } using (new EditorGUILayout.HorizontalScope()) { if (Installer.Demo.HAS_SCENE_PACKAGE == true) { EditorGUILayout.LabelField("Profiles and sample textures", EditorStyles.miniLabel); } if (Installer.Demo.HAS_SCENE_PACKAGE == false && Installer.Demo.SCENES_INSTALLED == false) { EditorGUILayout.HelpBox("Also import the \"_Samples.unitypackage\" file to install.", MessageType.None); } } if (Installer.CURRENTLY_INSTALLING || Installer.IS_INSTALLED) { EditorGUILayout.Space(); EditorGUILayout.LabelField("Log", SCPE_GUI.Header); EditorGUILayout.Space(); using (new EditorGUILayout.VerticalScope(EditorStyles.textArea, UnityEngine.GUILayout.MaxHeight(150f))) { scrollPos = EditorGUILayout.BeginScrollView(scrollPos); for (int i = 0; i < Installer.Log.NumItems; i++) { SCPE_GUI.DrawLogLine(Installer.Log.Read(i)); } if (Installer.CURRENTLY_INSTALLING) { scrollPos.y += 10f; } EditorGUILayout.EndScrollView(); } if (Installer.IS_INSTALLED) { //EditorGUILayout.HelpBox("Shaders have been configured for use with the " + PostProcessingInstallation.Config + " installation of the Post Processing Stack. You can reconfigure them through the Help window,", MessageType.None); } } }
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); }
void DrawHeader() { SCPE_GUI.DrawWindowHeader(width, height); GUILayout.Label("Version: " + SCPE.INSTALLED_VERSION, SCPE_GUI.Footer); }
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); * } * } */ } }
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(); } } } } }
private void OnGUI() { if (INSTALLATION_TAB < 0) { INSTALLATION_TAB = 0; } if (EditorApplication.isCompiling) { this.ShowNotification(new GUIContent(" Compiling...", EditorGUIUtility.IconContent("cs Script Icon").image)); } else { this.RemoveNotification(); } //Header { if (SCPE_GUI.HeaderImg) { Rect headerRect = new Rect(0, -5, width, SCPE_GUI.HeaderImg.height); UnityEngine.GUI.DrawTexture(headerRect, SCPE_GUI.HeaderImg, ScaleMode.ScaleToFit); GUILayout.Space(SCPE_GUI.HeaderImg.height - 10); } else { EditorGUILayout.Space(); EditorGUILayout.LabelField("<b><size=24>SC Post Effects</size></b>\n<size=16>For Post Processing Stack</size>", SCPE_GUI.Header); } using (new EditorGUILayout.HorizontalScope()) { using (new EditorGUI.DisabledGroupScope((int)INSTALLATION_TAB != 0)) { GUILayout.Toggle((INSTALLATION_TAB == 0), new GUIContent("Pre-install"), SCPE_GUI.ProgressTab); } using (new EditorGUI.DisabledGroupScope((int)INSTALLATION_TAB != 1)) { GUILayout.Toggle(((int)INSTALLATION_TAB == 1), "Installation", SCPE_GUI.ProgressTab); } using (new EditorGUI.DisabledGroupScope((int)INSTALLATION_TAB != 2)) { GUILayout.Toggle(((int)INSTALLATION_TAB == 2), "Finish", SCPE_GUI.ProgressTab); } } } GUILayout.Space(5f); //Body Rect oRect = EditorGUILayout.GetControlRect(); Rect bodyRect = new Rect(oRect.x + 10, 115, width - 20, height); GUILayout.BeginArea(bodyRect); { switch (INSTALLATION_TAB) { case (Tab)0: StartScreen(); break; case (Tab)1: InstallScreen(); break; case (Tab)2: FinalScreen(); break; } } GUILayout.EndArea(); //Progress buttons Rect errorRect = new Rect(225, height - 95, width * 2.2f, 25); GUILayout.BeginArea(errorRect); if (hasError) { SCPE_GUI.DrawStatusString("Correct any errors to continue", SCPE_GUI.Status.Error, false); } GUILayout.EndArea(); Rect buttonRect = new Rect(width / 2, height - 70, width / 2.2f, height - 25); GUILayout.BeginArea(buttonRect); using (new EditorGUILayout.HorizontalScope()) { //EditorGUILayout.PrefixLabel(" "); //Disable buttons when installing using (new EditorGUI.DisabledGroupScope(Installer.CURRENTLY_INSTALLING)) { //Disable back button on first screen using (new EditorGUI.DisabledGroupScope(INSTALLATION_TAB == Tab.Start)) { if (GUILayout.Button("<size=16>‹</size> Back", SCPE_GUI.ProgressButtonLeft)) { INSTALLATION_TAB--; } } using (new EditorGUI.DisabledGroupScope(hasError)) { string btnLabel = string.Empty; if (INSTALLATION_TAB == Tab.Start) { btnLabel = "Next <size=16>›</size>"; } if (INSTALLATION_TAB == Tab.Install) { btnLabel = "Install <size=16>›</size>"; } if (INSTALLATION_TAB == Tab.Install && Installer.IS_INSTALLED) { btnLabel = "Finish"; } if (INSTALLATION_TAB == Tab.Finish) { btnLabel = "Close"; } if (GUILayout.Button(btnLabel, SCPE_GUI.ProgressButtonRight)) { if (INSTALLATION_TAB == Tab.Start) { INSTALLATION_TAB = Tab.Install; return; } //When pressing install again if (INSTALLATION_TAB == Tab.Install) { if (Installer.IS_INSTALLED == false) { Installer.Install(); } else { INSTALLATION_TAB = Tab.Finish; } return; } if (INSTALLATION_TAB == Tab.Finish) { Installer.PostInstall(); this.Close(); } } } } } GUILayout.EndArea(); //Footer buttonRect = new Rect(width / 4, height - 30, width / 2.1f, height - 25); GUILayout.BeginArea(buttonRect); EditorGUILayout.LabelField("- Staggart Creations -", SCPE_GUI.Footer); GUILayout.EndArea(); }
public override void OnInspectorGUI() { SCPE_GUI.DisplayDocumentationButton("edge-detection"); SCPE_GUI.DisplayVRWarning(); SCPE_GUI.DisplaySetupWarning(); PropertyField(edgesOnly); PropertyField(mode); if (mode.overrideState.boolValue) { EditorGUILayout.BeginHorizontal(); switch (mode.value.intValue) { case 0: EditorGUILayout.HelpBox("Checks pixels for differences between geometry normals and their distance from the camera", MessageType.None); break; case 1: EditorGUILayout.HelpBox("Same as Depth Normals but also uses vertical sampling for improved accuracy", MessageType.None); break; case 2: EditorGUILayout.HelpBox("Draws edges only where neighboring pixels greatly differ in their depth value.", MessageType.None); break; case 3: EditorGUILayout.HelpBox("Creates an edge where the luminance value of a pixel differs from its neighbors, past the threshold", MessageType.None); break; } EditorGUILayout.EndHorizontal(); } #if LWRP if (mode.value.intValue < 2 && mode.overrideState.boolValue == true && RenderPipelineManager.currentPipeline != null) { EditorGUILayout.HelpBox("Not supported in LWRP", MessageType.Error); } #endif using (new EditorGUILayout.HorizontalScope()) { // Override checkbox var overrideRect = GUILayoutUtility.GetRect(17f, 17f, GUILayout.ExpandWidth(false)); overrideRect.yMin += 4f; EditorUtilities.DrawOverrideCheckbox(overrideRect, fadeDistance.overrideState); EditorGUILayout.PrefixLabel(fadeDistance.displayName); GUILayout.FlexibleSpace(); fadeDistance.value.floatValue = EditorGUILayout.FloatField(fadeDistance.value.floatValue); bool enabled = invertFadeDistance.value.boolValue; enabled = GUILayout.Toggle(enabled, "Start", EditorStyles.miniButtonLeft, GUILayout.Width(50f), GUILayout.ExpandWidth(false)); enabled = !GUILayout.Toggle(!enabled, "End", EditorStyles.miniButtonRight, GUILayout.Width(50f), GUILayout.ExpandWidth(false)); invertFadeDistance.value.boolValue = enabled; } if (mode.value.intValue < 2) { PropertyField(sensitivityDepth); PropertyField(sensitivityNormals); } else if (mode.value.intValue == 2) { PropertyField(edgeExp); } else { // lum based mode PropertyField(lumThreshold); } //Edges PropertyField(edgeColor); PropertyField(edgeOpacity); PropertyField(sampleDist); if (mode.value.intValue == 2) { PropertyField(sobelThin); } }