Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryConvert<TSource, TDestination>(ref TSource, out TDestination)

Converts the specified value from TSource to TDestination using the registered global converters.
Read time 1 minuteLast updated 8 days ago

Definition

TryConvert<T, U>(T, T)

public static bool TryConvert<TSource, TDestination>(ref TSource source, out TDestination destination)

Parameters

source

T
The source value to convert.

destination

T
The converted destination value if the conversion succeeded, and the default value otherwise.

Returns

Type

Description

bool
true
if the conversion succeeded, and
false
otherwise.