文档

Unity Engine

Unity Engine

TryCreateInstance(out TContainer)

Tries to create a new instance of TContainer.
阅读时间1 分钟最后更新于 2 天前

Definition

TryCreateInstance(T)

bool TryCreateInstance(out TContainer instance)

Parameters

instance

T
When this method returns, contains the created instance, if type construction succeeded; otherwise, the default value for \<typeparamref name="TContainer" /\>.

Returns

Type

Description

bool
true
if a new instance of type TContainer was created; otherwise,
false
.