docs.unity3d.com
    Show / Hide Table of Contents

    Interface ICustomStyle

    This interface exposes methods to read custom style properties applied from USS files to visual elements.

    Namespace: UnityEngine.UIElements
    Syntax
    public interface ICustomStyle

    Methods

    TryGetValue(CustomStyleProperty<Color>, out Color)

    Gets the value associated with the specified .

    Declaration
    bool TryGetValue(CustomStyleProperty<Color> property, out Color value)
    Parameters
    Type Name Description
    CustomStyleProperty<Color> property
    Color value
    Returns
    Type Description
    Boolean

    True if the property is found, false if not.

    TryGetValue(CustomStyleProperty<Sprite>, out Sprite)

    Gets the value associated with the specified .

    Declaration
    bool TryGetValue(CustomStyleProperty<Sprite> property, out Sprite value)
    Parameters
    Type Name Description
    CustomStyleProperty<Sprite> property
    Sprite value
    Returns
    Type Description
    Boolean

    True if the property is found, false if not.

    TryGetValue(CustomStyleProperty<Boolean>, out Boolean)

    Gets the value associated with the specified .

    Declaration
    bool TryGetValue(CustomStyleProperty<bool> property, out bool value)
    Parameters
    Type Name Description
    CustomStyleProperty<Boolean> property
    Boolean value
    Returns
    Type Description
    Boolean

    True if the property is found, false if not.

    TryGetValue(CustomStyleProperty<Int32>, out Int32)

    Gets the value associated with the specified .

    Declaration
    bool TryGetValue(CustomStyleProperty<int> property, out int value)
    Parameters
    Type Name Description
    CustomStyleProperty<Int32> property
    Int32 value
    Returns
    Type Description
    Boolean

    True if the property is found, false if not.

    TryGetValue(CustomStyleProperty<Single>, out Single)

    Gets the value associated with the specified .

    Declaration
    bool TryGetValue(CustomStyleProperty<float> property, out float value)
    Parameters
    Type Name Description
    CustomStyleProperty<Single> property
    Single value
    Returns
    Type Description
    Boolean

    True if the property is found, false if not.

    TryGetValue(CustomStyleProperty<String>, out String)

    Gets the value associated with the specified .

    Declaration
    bool TryGetValue(CustomStyleProperty<string> property, out string value)
    Parameters
    Type Name Description
    CustomStyleProperty<String> property
    String value
    Returns
    Type Description
    Boolean

    True if the property is found, false if not.

    TryGetValue(CustomStyleProperty<Texture2D>, out Texture2D)

    Gets the value associated with the specified .

    Declaration
    bool TryGetValue(CustomStyleProperty<Texture2D> property, out Texture2D value)
    Parameters
    Type Name Description
    CustomStyleProperty<Texture2D> property
    Texture2D value
    Returns
    Type Description
    Boolean

    True if the property is found, false if not.

    TryGetValue(CustomStyleProperty<VectorImage>, out VectorImage)

    Gets the value associated with the specified .

    Declaration
    bool TryGetValue(CustomStyleProperty<VectorImage> property, out VectorImage value)
    Parameters
    Type Name Description
    CustomStyleProperty<VectorImage> property
    VectorImage value
    Returns
    Type Description
    Boolean

    True if the property is found, false if not.

    In This Article
    • Methods
      • TryGetValue(CustomStyleProperty<Color>, out Color)
      • TryGetValue(CustomStyleProperty<Sprite>, out Sprite)
      • TryGetValue(CustomStyleProperty<Boolean>, out Boolean)
      • TryGetValue(CustomStyleProperty<Int32>, out Int32)
      • TryGetValue(CustomStyleProperty<Single>, out Single)
      • TryGetValue(CustomStyleProperty<String>, out String)
      • TryGetValue(CustomStyleProperty<Texture2D>, out Texture2D)
      • TryGetValue(CustomStyleProperty<VectorImage>, out VectorImage)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023