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. |