MotionBlurEditor.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using UnityEngine.Rendering.Universal;
  2. namespace UnityEditor.Rendering.Universal
  3. {
  4. [VolumeComponentEditor(typeof(MotionBlur))]
  5. sealed class MotionBlurEditor : VolumeComponentEditor
  6. {
  7. //SerializedDataParameter m_Mode;
  8. SerializedDataParameter m_Quality;
  9. SerializedDataParameter m_Intensity;
  10. SerializedDataParameter m_Clamp;
  11. public override void OnEnable()
  12. {
  13. var o = new PropertyFetcher<MotionBlur>(serializedObject);
  14. //m_Mode = Unpack(o.Find(x => x.mode));
  15. m_Quality = Unpack(o.Find(x => x.quality));
  16. m_Intensity = Unpack(o.Find(x => x.intensity));
  17. m_Clamp = Unpack(o.Find(x => x.clamp));
  18. }
  19. public override void OnInspectorGUI()
  20. {
  21. if (UniversalRenderPipeline.asset?.postProcessingFeatureSet == PostProcessingFeatureSet.PostProcessingV2)
  22. {
  23. EditorGUILayout.HelpBox(UniversalRenderPipelineAssetEditor.Styles.postProcessingGlobalWarning, MessageType.Warning);
  24. return;
  25. }
  26. //PropertyField(m_Mode);
  27. //if (m_Mode.value.intValue == (int)MotionBlurMode.CameraOnly)
  28. //{
  29. PropertyField(m_Quality);
  30. PropertyField(m_Intensity);
  31. PropertyField(m_Clamp);
  32. //}
  33. //else
  34. //{
  35. // EditorGUILayout.HelpBox("Object motion blur is not supported on the Universal Render Pipeline yet.", MessageType.Info);
  36. //}
  37. }
  38. }
  39. }