Description
The Slider
field is a member of the Editor.ShaderGraph.UIType
enumeration. It represents a UI element type used within the Shader Graph editor to provide a slider interface for adjusting values. This is particularly useful for parameters that require a range of values, allowing users to intuitively modify shader properties by sliding a control.
Usage
Use the Slider
field when you need to define a shader property that should be adjusted using a slider control in the Shader Graph editor. This is ideal for properties that have a continuous range of values, such as float values representing intensity, opacity, or other similar parameters.
Example
// Example of using UIType.Slider in a shader graph context
public class MyShaderGraphComponent : Component
{
public void SetupShaderGraph()
{
// Assume shaderGraph is an instance of a ShaderGraph class
shaderGraph.AddProperty("MyFloatProperty", UIType.Slider);
}
}