Version: Unity 6.4 Alpha (6000.4)
LanguageEnglish
  • C#

IConstantNode.TryGetValue

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public bool TryGetValue(out T value);

Parameters

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

Returns

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

Description

Attempts to retrieve the value of the constant node as the specified type.

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 is set to the default value of T.