Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryGetDefaultValue<T>(out T)

Retrieves the default value of the variable.
Read time 1 minuteLast updated 6 days ago

Definition

TryGetDefaultValue<T>(T)

bool TryGetDefaultValue<T>(out T value)

Parameters

value

T
The retrieved default value, if available.

Returns

Type

Description

bool
true
if a default value exists and is of the correct type; otherwise,
false
.

Remarks

Use this method to retrieve the variable’s default value in a type-safe way.