You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

52 lines
2.2 KiB

using UnityEngine.Rendering.HighDefinition;
namespace UnityEditor.Rendering.HighDefinition
{
[CanEditMultipleObjects]
[CustomEditor(typeof(HighQualityLineRenderingVolumeComponent))]
class HighQualityLineRenderingVolumeComponentEditor : VolumeComponentEditor
{
SerializedDataParameter m_Enable;
SerializedDataParameter m_CompositionMode;
SerializedDataParameter m_ClusterCount;
SerializedDataParameter m_SortingQuality;
SerializedDataParameter m_TileOpacityThreshold;
public override void OnEnable()
{
var o = new PropertyFetcher<HighQualityLineRenderingVolumeComponent>(serializedObject);
m_Enable = Unpack(o.Find(x => x.enable));
m_CompositionMode = Unpack(o.Find(x => x.compositionMode));
m_ClusterCount = Unpack(o.Find(x => x.clusterCount));
m_SortingQuality = Unpack(o.Find(x => x.sortingQuality));
m_TileOpacityThreshold = Unpack(o.Find(x => x.tileOpacityThreshold));
}
public override void OnInspectorGUI()
{
HDRenderPipelineAsset currentAsset = HDRenderPipeline.currentAsset;
bool notSupported = currentAsset != null && !currentAsset.currentPlatformRenderPipelineSettings.supportHighQualityLineRendering;
if (notSupported)
{
EditorGUILayout.Space();
HDEditorUtils.QualitySettingsHelpBox("The current HDRP Asset does not support High Quality Line Rendering.", MessageType.Warning,
HDRenderPipelineUI.ExpandableGroup.Rendering,
HDRenderPipelineUI.ExpandableRendering.Water, "m_RenderPipelineSettings.supportHighQualityLineRendering");
}
using var disableScope = new EditorGUI.DisabledScope(notSupported);
EditorGUILayout.LabelField("General", EditorStyles.miniLabel);
PropertyField(m_Enable);
PropertyField(m_CompositionMode);
EditorGUILayout.LabelField("Level of Detail");
PropertyField(m_ClusterCount);
PropertyField(m_SortingQuality);
PropertyField(m_TileOpacityThreshold);
}
}
}