기술 자료

Unity Engine

Unity Engine

TryGetValueFromBag<T>(IUxmlAttributes, CreationContext, Func<string, T, T>, T, ref T)

Tries to get the attribute value from the attribute bag.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

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

경고
Deprecated. UxmlTraits system is deprecated and will be removed. Use UxmlElementAttribute instead.
protected bool TryGetValueFromBag<T>(IUxmlAttributes bag, CreationContext cc, Func<string, T, T> converterFunc, T defaultValue, ref T value)

Parameters

A bag contains 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.

value

T
If the attribute could be retrieved, the retrieved value converted by the conversion function or the default value if the retrieved value could not de converted.

Returns

Type

Description

boolTrue if the value is found, false otherwise.