文档

Unity Engine

Unity Engine

TryGetValue<T>(out T)

Tries to retrieve the value of the node option using the specified type.
阅读时间1 分钟最后更新于 1 个月前

Definition

TryGetValue<T>(T)

bool TryGetValue<T>(out T value)

Parameters

value

T
The variable to assign the value to, if retrieval succeeds.

Returns

Type

Description

bool
true
if the option exists and the type matches; otherwise,
false
.

Remarks

If the value was never explicitly set, this method still returns
true
, and
value
will contain the default value for type
T
.