Class VolumeParameterDrawer
A base class to implement to draw custom editors for custom Volume
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 Volume
Examples
Here's an example about how Clamped
[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
IsAutoProperty()
Override this and return false
if you want to customize the position of the override
checkbox. If you don't, Unity automatically draws the checkbox and puts the property content in a
horizontal scope.
Declaration
public virtual bool IsAutoProperty()
Returns
Type | Description |
---|---|
bool |
|
See Also
OnGUI(SerializedDataParameter, GUIContent)
Draws the parameter in the editor. If the input parameter is invalid you should return
false
so that Unity displays the default editor for this parameter.
Declaration
public abstract bool OnGUI(SerializedDataParameter parameter, GUIContent title)
Parameters
Type | Name | Description |
---|---|---|
Serialized |
parameter | The parameter to draw. |
GUIContent | title | The label and tooltip of the parameter. |
Returns
Type | Description |
---|---|
bool |
|