ドキュメント

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 分最終更新 1ヶ月前

Definition

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

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.