using System; #if UNITY_EDITOR using UnityEditor.Rendering; #endif namespace UnityEngine.Rendering { /// /// A to associate with a and store project-wide settings for that pipeline. /// You can register a single instance to the by using . You can use this to save `RenderPipeline` settings that appear in `GraphicsSettings`. /// /// /// public abstract class RenderPipelineGlobalSettings : RenderPipelineGlobalSettings where TRenderPipeline : RenderPipeline where TGlobalRenderPipelineSettings : RenderPipelineGlobalSettings { /// /// Active Global Settings asset. If the value is `null` then no `TGlobalRenderPipelineSettings` is registered to the Graphics Settings with the `TRenderPipeline`. /// #if UNITY_EDITOR public static TGlobalRenderPipelineSettings instance => EditorGraphicsSettings.GetRenderPipelineGlobalSettingsAsset() as TGlobalRenderPipelineSettings; #else public static TGlobalRenderPipelineSettings instance => s_Instance.Value; private static Lazy s_Instance = new (() => GraphicsSettings.GetSettingsForRenderPipeline() as TGlobalRenderPipelineSettings); #endif /// /// Called when settings asset is reset in the editor. /// public virtual void Reset() { #if UNITY_EDITOR EditorGraphicsSettings.PopulateRenderPipelineGraphicsSettings(this); Initialize(); #endif } } }