/// <summary>Detects which render pipeline is being used and configures them for rendering</summary> void RefreshRenderPipelineMode() { var pipelineType = RenderPipelineManager.currentPipeline != null?RenderPipelineManager.currentPipeline.GetType() : null; #if MODULE_RENDER_PIPELINES_HIGH_DEFINITION if (pipelineType == typeof(HDRenderPipeline)) { if (detectedRenderPipeline != DetectedRenderPipeline.HDRP) { detectedRenderPipeline = DetectedRenderPipeline.HDRP; if (!_instance.gameObject.TryGetComponent <CustomPassVolume>(out CustomPassVolume volume)) { volume = _instance.gameObject.AddComponent <CustomPassVolume>(); volume.isGlobal = true; volume.injectionPoint = CustomPassInjectionPoint.AfterPostProcess; volume.customPasses.Add(new AlineHDRPCustomPass()); } } return; } #endif #if MODULE_RENDER_PIPELINES_UNIVERSAL if (pipelineType == typeof(UniversalRenderPipeline)) { // Note: Renderer2D is in internal class so we need to use the name for comparison if (detectedRenderPipeline != DetectedRenderPipeline.URP && UniversalRenderPipeline.asset.scriptableRenderer.GetType().Name == "Renderer2D") { #if UNITY_EDITOR Debug.LogWarning("The A* Pathfinding Project visualization system does not fully support the URP Experimental 2D Renderer since the 2D renderer does not yet have an extensible post processing system.\n" + "You may not see graphs or other gizmos in the scene view if you use the 2D renderer. This does not impact any other functionality of the A* Pathfinding Project.\n" + "The URP 2D renderer will be fully supported as soon as it is technically possible to do so."); #endif } detectedRenderPipeline = DetectedRenderPipeline.URP; return; } #endif detectedRenderPipeline = DetectedRenderPipeline.BuiltInOrCustom; }
/// <summary>Detects which render pipeline is being used and configures them for rendering</summary> void RefreshRenderPipelineMode() { var pipelineType = RenderPipelineManager.currentPipeline != null?RenderPipelineManager.currentPipeline.GetType() : null; #if MODULE_RENDER_PIPELINES_HIGH_DEFINITION if (pipelineType == typeof(HDRenderPipeline)) { if (detectedRenderPipeline != DetectedRenderPipeline.HDRP) { detectedRenderPipeline = DetectedRenderPipeline.HDRP; if (!_instance.gameObject.TryGetComponent <CustomPassVolume>(out CustomPassVolume volume)) { volume = _instance.gameObject.AddComponent <CustomPassVolume>(); volume.isGlobal = true; volume.injectionPoint = CustomPassInjectionPoint.AfterPostProcess; volume.customPasses.Add(new AlineHDRPCustomPass()); } } return; } #endif #if MODULE_RENDER_PIPELINES_UNIVERSAL if (pipelineType == typeof(UniversalRenderPipeline)) { // Note: Renderer2D is in internal class so we need to use the name for comparison if (detectedRenderPipeline != DetectedRenderPipeline.URP && UniversalRenderPipeline.asset.GetRenderer(-1).GetType().Name == "Renderer2D") { Debug.LogWarning("ALINE does not fully support the URP Experimental 2D Renderer since the 2D renderer does not yet have an extensible post processing system.\n" + "If you want to use ALINE please use the non-experimental forward renderer, the HDRP pipeline or the built-in render pipeline instead.\n" + "The URP 2D renderer will be fully supported as soon as it is technically possible to do so."); } detectedRenderPipeline = DetectedRenderPipeline.URP; return; } #endif detectedRenderPipeline = DetectedRenderPipeline.BuiltInOrCustom; }