Class ToggleControl
Represents a control with a checkbox for setting a float property to 2 defined values.
Namespace: VRLabs.SimpleShaderInspectors.Controls
Syntax
public class ToggleControl : PropertyControl
Remarks
This control can be used to set a float property between 2 values, which can come useful when there's a need to toggle on and off features using a float value in shader.
Both the enabled and disabled state can be set to give the material property a specific float value. If not set in the constructor they will be set to 0 for disabled and 1 for enabled.
Examples
Example usage:
// adds a toggle that toggles between 0 and 1
this.AddToggleControl("_ExampleProperty");
// adds a toggle that toggles between 3 and 7
this.AddToggleControl("_ExampleProperty", 3, 7);
Constructors
| Name | Description |
|---|---|
| ToggleControl(String, Single, Single) | Default constructor of ToggleControl |
Fields
| Name | Description |
|---|---|
| falseValue | Float value that the Enabled bool gets converted if false. |
| trueValue | Float value that the Enabled bool gets converted if true. |
Properties
| Name | Description |
|---|---|
| ToggleEnabled | Boolean indicating if the toggle is enabled or not. |
Methods
| Name | Description |
|---|---|
| ControlGUI(MaterialEditor) | Draws the control represented by this object. |