Search Results for

    Show / Hide Table of Contents

    Class TextureControl

    Represents a control for a texture property with possibility to inline 2 extra properties.

    Inheritance
    Object
    SimpleControl
    PropertyControl
    TextureControl
    GradientTextureControl
    GradientTextureControl
    TextureGeneratorControl
    TextureGeneratorControl
    Implements
    IAdditionalProperties
    Namespace: VRLabs.SimpleShaderInspectors.Controls
    Syntax
    public class TextureControl : PropertyControl, IAdditionalProperties
    Remarks

    It can be considered the Simple Shader Inspector equivalent of MaterialEditor.TexturePropertySingleLine where you can pass a texture property followed by up to 2 additional properties

    Unlike MaterialEditor.TexturePropertySingleLine it does add the possibility to edit texture tiling and offset, in the form of an optional gear icon on the side (the icon can be changed)

    Examples

    Example usage:

    // Adds a texture control with an additional color and float properties
    this.AddTextureControl("_TextureProperty", "_ColorProperty", "_FloatProperty"); 
    
    // Adds a texture control with an additional color property and editable tiling and offset
    this.AddTextureControl("_TextureProperty", "_ColorProperty").SetShowUvOptions(true);

    Constructors

    Name Description
    TextureControl(String, String, String)

    Default constructor of TextureControl

    Fields

    Name Description
    _hasExtra1

    Indicates if the control has the first extra property.

    _hasExtra2

    Indicates if the control has the second extra property.

    _isUVButtonPressed

    Indicates if the uv button is pressed and the tiling and offset area is visible.

    Properties

    Name Description
    AdditionalProperties

    Extra properties array. Implementation of IAdditionalProperties.

    HasHDRColor

    Boolean that defines if the control needs to render the second material property as an hdr color field, only works if there is only one extra property and it's a color property.

    ShowUvOptions

    Boolean that defines if the control will show up an additional button to have access to the texture tiling and offset options.

    UVAreaColor

    Background color for the uv button.

    UVAreaStyle

    Style for the tiling and offset background area.

    UVButtonColor

    Color for the tiling and offset button.

    UVButtonStyle

    Style for the tiling and offset options button.

    Methods

    Name Description
    ControlGUI(MaterialEditor)

    Draws the control represented by this object.

    DrawTextureSingleLine(MaterialEditor)

    Extension Methods

    Chainables.Alias<T>(T, String)
    Chainables.SetVisibility<T>(T, Boolean)
    Chainables.SetEnabled<T>(T, Boolean)
    Chainables.SetShowUvOptions<T>(T, Boolean)
    Chainables.SetHasHDRColor<T>(T, Boolean)
    Chainables.SetUVButtonStyle<T>(T, GUIStyle)
    Chainables.SetUVAreaStyle<T>(T, GUIStyle)
    Chainables.SetUVButtonColor<T>(T, Color)
    Chainables.SetUVAreaColor<T>(T, Color)
    In This Article
    Back to top Copyright © VRLabs.
    Generated by DocFX