Legacy Documentation: Version 2018.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Experimental: this API is experimental and might be changed or removed in the future.

StyleValue<T0>

struct in UnityEngine.Experimental.UIElements.StyleSheets

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

This generic structure encodes a value type that can come from USS or be specified programmatically.

A StyleValue<T> struct wraps value types such as an integer or a color along with some metadata for the application of USS at runtime.

Static Properties

nilThis represents the default value for a StyleValue<T> of the according generic type.

Properties

valueThe actual value of the StyleValue<T>.

Constructors

StyleValue_1This constructor can be used to specified an alternate default value but it is recommended to use StyleValue<T>.nil.

Public Methods

GetSpecifiedValueOrDefaultUtility function to be used when reading custom styles values and provide a default value in one step.

Static Methods

CreateCreates a StyleValue of the according generic type directly from a value.
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答