using UnityEngine; using UnityEngine.Rendering.HighDefinition; using UnityEngine.Rendering; namespace UnityEditor.Rendering.HighDefinition { /// /// Base class to inherit to create custom post process volume editors. /// [CanEditMultipleObjects] [CustomEditor(typeof(CustomPostProcessVolumeComponent), true)] public class CustomPostProcessVolumeComponentEditor : VolumeComponentEditor { internal static class Styles { public const string helpBoxLabel = "Custom Post Process Order"; public const string helpBoxMessage = "This Custom Post Process is not registered in ProjectSettings > Graphics."; } /// /// Unity calls this method each time it re-draws the Inspector. /// /// /// You can safely override this method and not call base.OnInspectorGUI() unless you /// want Unity to display all the properties from the /// automatically. /// public override void OnInspectorGUI() { if (GraphicsSettings.TryGetRenderPipelineSettings(out var customPPOrders) && customPPOrders.IsCustomPostProcessRegistered(target.GetType())) { base.OnInspectorGUI(); } else { HDEditorUtils.GlobalSettingsHelpBox(Styles.helpBoxMessage, MessageType.Error); } } } }