Class OrderedSection
Section that can be hidden and ordered when in groups.
Namespace: VRLabs.SimpleShaderInspectors.Controls.Sections
Syntax
public class OrderedSection : Section, IControlContainer, INonAnimatableProperty, IAdditionalProperties
Remarks
It can be considered an additional evolution of ActivatableSection, but it actually inherits directly from Section.
Functionality wise it acts pretty much the same as ActivatableSection, the main difference is in how it does that. Namely instead of having a disabled state, it gets disabled it completely disappears from the ui, resulting in an overall cleaner ui.
Unlike other types of sections, this one cannot be added directly to the inspector, instead it has to be added to an OrderedSectionGroup in order to work properly. In fact the only way to enable a previously disabled OrderedSection in the ui is by using the add button provided by OrderedSectionGroup
Another quirk of this type of section is that it can be moved up or down relative to the sections of the same group, letting the user order them in whichever way they see fit best.
Examples
Example usage:
// Adds an OrderedSection to the current inspector
OrderedSectionGroup group = this.AddOrderedSectionGroup("GroupAlias");
// Adds an OrderedSection using the specified property as activation property
group.AddOrderedSection("_ActivateProperty");
// Adds an OrderedSection using the specified property as activation property,
// the values for activation are set to 2-3 respectively when disabled and enabled
group.AddOrderedSection("_ActivateProperty", 2, 3);
// Adds an OrderedSection using the specified properties for activation and folding state
group.AddOrderedSection("_ActivateProperty", "_ShowProperty");
// Adds an OrderedSection using the specified properties for activation and folding state,
// the values for activation are set to 2-3 respectively when disabled and enabled
// the values for folding are set to 4-6 respectively when folded in and out
group.AddOrderedSection("_ActivateProperty", "_ShowProperty", 2, 3, 4, 6);
Constructors
| Name | Description |
|---|---|
| OrderedSection(String, Single, Single) | Default constructor of OrderedSection. |
| OrderedSection(String, String, Single, Single, Single, Single) | Constructor of OrderedSection used when creating a property driven OrderedSection. |
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. |
| PushState | Indicates if the section should be pushed up or down relative to its neighbour sections. |
Properties
| Name | Description |
|---|---|
| AdditionalProperties | Extra properties array. Implementation needed by IAdditionalProperties. |
| DeleteColor | Color of the delete icon. |
| DeleteIcon | Style for the delete icon. |
| DownColor | Color of the down icon. |
| DownIcon | Style for the down icon. |
| Enabled | Boolean indicating if the section is enabled or not. |
| HasActivatePropertyUpdated | Boolean indicating if the activate property has been updated this cycle. |
| HasSectionTurnedOn | Boolean indicating if the section has turned on this cycle. |
| SectionPosition | integer indicating the position of the section in the group. |
| UpColor | Color of the up icon. |
| UpIcon | Style for the up icon. |
Methods
| Name | Description |
|---|---|
| ControlGUI(MaterialEditor) | Draws the control represented by this object. |
| DrawSideButtons() | Draws and handles the up, down and delete icon on the side. |
| PredrawUpdate(MaterialEditor) |