UnityGame/Library/PackageCache/com.unity.render-pipelines.universal/Editor/Overrides/BloomEditor.cs

54 lines
1.9 KiB
C#
Raw Permalink Normal View History

2024-10-27 10:53:47 +03:00
using System.Linq;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace UnityEditor.Rendering.Universal
{
[CustomEditor(typeof(Bloom))]
sealed class BloomEditor : VolumeComponentEditor
{
SerializedDataParameter m_Threshold;
SerializedDataParameter m_Intensity;
SerializedDataParameter m_Scatter;
SerializedDataParameter m_Clamp;
SerializedDataParameter m_Tint;
SerializedDataParameter m_HighQualityFiltering;
SerializedDataParameter m_Downsample;
SerializedDataParameter m_MaxIterations;
SerializedDataParameter m_DirtTexture;
SerializedDataParameter m_DirtIntensity;
public override void OnEnable()
{
var o = new PropertyFetcher<Bloom>(serializedObject);
m_Threshold = Unpack(o.Find(x => x.threshold));
m_Intensity = Unpack(o.Find(x => x.intensity));
m_Scatter = Unpack(o.Find(x => x.scatter));
m_Clamp = Unpack(o.Find(x => x.clamp));
m_Tint = Unpack(o.Find(x => x.tint));
m_HighQualityFiltering = Unpack(o.Find(x => x.highQualityFiltering));
m_Downsample = Unpack(o.Find(x => x.downscale));
m_MaxIterations = Unpack(o.Find(x => x.maxIterations));
m_DirtTexture = Unpack(o.Find(x => x.dirtTexture));
m_DirtIntensity = Unpack(o.Find(x => x.dirtIntensity));
}
public override void OnInspectorGUI()
{
PropertyField(m_Threshold);
PropertyField(m_Intensity);
PropertyField(m_Scatter);
PropertyField(m_Tint);
PropertyField(m_Clamp);
PropertyField(m_HighQualityFiltering);
PropertyField(m_Downsample);
PropertyField(m_MaxIterations);
PropertyField(m_DirtTexture);
PropertyField(m_DirtIntensity);
}
}
}