Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryGetValue<T>(out T)

Retrieves the value of the constant node as the specified type.
Read time 1 minuteLast updated 7 days ago

Definition

TryGetValue<T>(T)

bool TryGetValue<T>(out T value)

Parameters

value

T
The output parameter that holds the value if the conversion is successful.

Returns

Type

Description

bool
true
if the value was successfully retrieved and cast to
T
; otherwise,
false
.

Remarks

This method provides type-safe access to the constant's stored value. It performs a type check and conversion internally. If the value cannot be cast to
T
, the method returns
false
and
value
is set to the default value of
T
.