Class VolumeParameterDrawer
A base class to implement to draw custom editors for custom VolumeParameter. You must use a VolumeParameterDrawerAttribute to let the editor know which parameter this drawer is for.
Inherited Members
Namespace: UnityEditor.Rendering
Assembly: Unity.RenderPipelines.Core.Editor.dll
Syntax
public abstract class VolumeParameterDrawer
Remarks
If you do not provide a custom editor for a VolumeParameter, Unity uses the buil-in property drawers to draw the property as-is.
Examples
Here's an example about how ClampedFloatParameter is implemented:
[VolumeParameterDrawer(typeof(ClampedFloatParameter))]
class ClampedFloatParameterDrawer : VolumeParameterDrawer
{
public override bool OnGUI(SerializedDataParameter parameter, GUIContent title)
{
var value = parameter.value;
if (value.propertyType != SerializedPropertyType.Float)
return false;
var o = parameter.GetObjectRef<ClampedFloatParameter>();
EditorGUILayout.Slider(value, o.min, o.max, title);
value.floatValue = Mathf.Clamp(value.floatValue, o.min, o.max);
return true;
}
}
Methods
Name | Description |
---|---|
IsAutoProperty() | Override this and return |
OnGUI(SerializedDataParameter, GUIContent) | Draws the parameter in the editor. If the input parameter is invalid you should return
|