ドキュメント

Unity Engine

Unity Engine

GetValueFromBag<T>(IUxmlAttributes, CreationContext, Func<string, T, T>, T)

Get the attribute value from the attribute bag.
読み終わるまでの所要時間 1 分最終更新 20日前

Definition

注意
Deprecated. UxmlTraits system is deprecated and will be removed. Use UxmlElementAttribute instead.
protected T GetValueFromBag<T>(IUxmlAttributes bag, CreationContext cc, Func<string, T, T> converterFunc, T defaultValue)

Parameters

A bag containing attributes and their values as strings.

The context in which the values are retrieved.

converterFunc

A function to convert a string value to type T.

defaultValue

T
The value to return if the attribute is not found in the bag.

Returns

Type

Description

TThe attribute value from the bag, or defaultValue if the attribute is not found.

Remarks

The attribute is looked up using UxmlAttributeDescription.name. If it is not found, each UxmlAttributeDescription.obsoleteNames is tried in turn, from first to last.