using System; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.UIElements; namespace UnityEditor.Rendering.HighDefinition { [CustomPropertyDrawer(typeof(HDRPDefaultVolumeProfileSettings))] [SupportedOnRenderPipeline(typeof(HDRenderPipelineAsset))] class HDRPDefaultVolumeProfileSettingsPropertyDrawer : DefaultVolumeProfileSettingsPropertyDrawer { GUIContent defaultVolumeProfileAssetLabel => EditorGUIUtility.TrTextContent("Default Profile", "Settings that will be applied project-wide to all Volumes by default when HDRP is active."); protected override GUIContent volumeInfoBoxLabel => EditorGUIUtility.TrTextContent( "The values in the Default Volume can be overridden by a Volume Profile assigned to HDRP asset and Volumes inside scenes."); protected override VisualElement CreateHeader() { var label = new Label("Default"); label.style.unityFontStyleAndWeight = FontStyle.Bold; return label; } protected override VisualElement CreateAssetFieldUI() { VisualElement profileLine = new(); var toggle = new Toggle(); toggle.AddToClassList(Foldout.toggleUssClassName); var checkmark = toggle.Q(className: Toggle.checkmarkUssClassName); checkmark.AddToClassList(Foldout.checkmarkUssClassName); var field = new ObjectField(defaultVolumeProfileAssetLabel.text) { tooltip = defaultVolumeProfileAssetLabel.tooltip, objectType = typeof(VolumeProfile), value = m_VolumeProfileSerializedProperty.objectReferenceValue as VolumeProfile, }; field.AddToClassList("unity-base-field__aligned"); //Align with other BaseField field.Q