Search Results for

    Show / Hide Table of Contents

    Class Section

    Represents a grouping of controls with an header that can be folded in and out.

    Inheritance
    Object
    SimpleControl
    PropertyControl
    Section
    ActivatableSection
    ActivatableSection
    OrderedSection
    OrderedSection
    Implements
    IControlContainer
    INonAnimatableProperty
    Namespace: VRLabs.SimpleShaderInspectors.Controls.Sections
    Syntax
    public class Section : PropertyControl, IControlContainer, INonAnimatableProperty
    Remarks

    On bigger shaders it may be needed to organize options in categories to make easier for the user to find the option they want to modify. This control makes you able to organize it with ease, by grouping controls under categories with a dedicated title.

    The folding state can be controlled either by the control alone, or driven by a material property. In this last case the folding state will stay saved between editor sessions.

    In case a material property isn't used, a default alias is used. This alias is shared between al sections, so you need to override it if you want to use a different string for each section.

    Examples

    Example usage:

    // Adds a section and sets its alias
    this.AddSection().Alias("ExampleAlias"); 
    
    // Adds a section that uses a material property for its folding state.
    this.AddSection("_ExampleProperty"); 
    
    // Adds a section that uses a material property for its folding state.
    // When not folded out the property value will be 2, when folded out 6
    this.AddSection("_ExampleProperty", 2, 6); 

    Constructors

    Name Description
    Section()

    Default constructor of Section.

    Section(String, Single, Single)

    Constructor of Section used when creating a property driven section

    Fields

    Name Description
    dictionaryKey

    String containing the key value that the section will use for the dictionary.

    firstCycle

    Boolean indicating if it's the first ui update.

    hideValue

    Float value that the Show bool gets converted if false.

    showValue

    Float value that the Show bool gets converted if true.

    useDictionary

    Boolean indicating if the section folding state is driven by an internal dictionary or not. It will be true in case you don't use a material property.

    Properties

    Name Description
    AreControlsInHeader

    Boolean indicating if child controls will be inside the header background.

    BackgroundColor

    Background color of the header.

    BackgroundStyle

    Style of the header background.

    Controls

    List of controls inside this section.

    IsPropertyAnimatable

    Boolean indicating if the folding state material property is animatable or not.

    LabelStyle

    Style of the header label.

    NonAnimatablePropertyChanged

    Boolean indicating if the folding state material property needs to be updated. Implementation needed by INonAnimatableProperty.

    Show

    Bool indicating if the section is folded out or not.

    ShowFoldoutArrow

    Boolean indicating if the foldout arrow is enabled or not.

    Methods

    Name Description
    AddControl(SimpleControl)
    ControlGUI(MaterialEditor)

    Draws the control represented by this object.

    DrawControls(MaterialEditor)

    Draws the list of controls that can be hidden by this control.

    GetControlList()
    SetupEnabled(MaterialEditor)

    Sets the Enabled boolean to the value currently in the source based on the settings of this control. Should only be used inside ControlGUI(MaterialEditor).

    UpdateEnabled(MaterialEditor)

    Updates the source of the Enabled boolean base on the settings of this control. Should only be used inside ControlGUI(MaterialEditor).

    UpdateNonAnimatableProperty(MaterialEditor)

    Updates properties that should not be animated, implementation needed by INonAnimatableProperty

    Extension Methods

    Chainables.AddPropertyControl(IControlContainer, String)
    Chainables.Alias<T>(T, String)
    Chainables.SetVisibility<T>(T, Boolean)
    Chainables.SetEnabled<T>(T, Boolean)
    Chainables.AddColorControl(IControlContainer, String, Boolean)
    Chainables.AddControlContainer(IControlContainer)
    Chainables.AddEnumControl<TEnum>(IControlContainer, String)
    Chainables.AddGradientTextureControl(IControlContainer, String, String)
    Chainables.AddKeywordToggleControl(IControlContainer, String)
    Chainables.AddKeywordToggleListControl(IControlContainer, String)
    Chainables.AddLabelControl(IControlContainer, String)
    Chainables.AddLightmapEmissionControl(IControlContainer)
    Chainables.AddSpaceControl(IControlContainer, Int32)
    Chainables.AddTextureControl(IControlContainer, String, String, String)
    Chainables.AddTextureGeneratorControl(IControlContainer, String, String, String)
    Chainables.AddTextureGeneratorControl(IControlContainer, ComputeShader, String, String, String, String)
    Chainables.AddTilingAndOffsetControl(IControlContainer, String)
    Chainables.AddToggleControl(IControlContainer, String, Single, Single)
    Chainables.AddToggleListControl(IControlContainer, String, Single, Single)
    Chainables.AddVectorControl(IControlContainer, String, Boolean, Boolean, Boolean, Boolean)
    Chainables.AddVertexStreamsControl(IControlContainer, String)
    Chainables.AddActivatableSection(IControlContainer, String, String, Single, Single, Single, Single)
    Chainables.AddActivatableSection(IControlContainer, String, Single, Single)
    Chainables.AddOrderedSectionGroup(IControlContainer, String)
    Chainables.AddSection(IControlContainer, String, Single, Single)
    Chainables.AddSection(IControlContainer)
    Chainables.SetLabelStyle<T>(T, GUIStyle)
    Chainables.SetBackgroundStyle<T>(T, GUIStyle)
    Chainables.SetAreControlsInHeader<T>(T, Boolean)
    Chainables.SetIsPropertyAnimatable<T>(T, Boolean)
    Chainables.SetShowFoldoutArrow<T>(T, Boolean)
    Chainables.SetBackgroundColor<T>(T, Color)
    In This Article
    Back to top Copyright © VRLabs.
    Generated by DocFX