Class ActivatableSection
Section that can be activated or deactivated thanks to a checkbox inside the header.
Namespace: VRLabs.SimpleShaderInspectors.Controls.Sections
Syntax
public class ActivatableSection : Section, IControlContainer, INonAnimatableProperty, IAdditionalProperties
Remarks
This more advanced version of Section has in addition one checkbox to enable/disable the content of the section. When disabled the content is still visible, but cannot be edited.
This section requires at least one material property to drive the enabled/disabled state, and it will use this material property name as alias.
Examples
Example usage:
// Add an activatable section
this.AddActivatableSection("_EnableProperty");
// Add an activatable section, the property will have the values of 2 and 4 when off and on respectively
this.AddActivatableSection("_EnableProperty", 2, 4);
// Add an activatable section with the show state being driven by a property
this.AddActivatableSection("_EnableProperty", "_ShowProperty");
// Add an activatable section, the properties will have set values when on and off, 2/4 for the enable one and 0/1 of the show one.
this.AddActivatableSection("_EnableProperty", "_ShowProperty", 2, 4, 0, 1);
Constructors
| Name | Description |
|---|---|
| ActivatableSection(String, Single, Single) | Default constructor of ActivatableSection. |
| ActivatableSection(String, String, Single, Single, Single, Single) | Constructor of ActivatableSection used when creating a property driven ActivatableSection. |
Fields
| Name | Description |
|---|---|
| disableValue | Float value that the Show bool gets converted if false. |
| enableValue | Float value that the Show bool gets converted if true. |
Properties
| Name | Description |
|---|---|
| AdditionalProperties | Extra properties array. Implementation needed by IAdditionalProperties. |
| Enabled | Boolean indicating if the section is enabled or not. |
| HasActivatePropertyUpdated | Has the property been updated this cycle? |
Methods
| Name | Description |
|---|---|
| ControlGUI(MaterialEditor) | Draws the control represented by this object. |