TryGetComponent

public bool TryGetComponent(out Component value) ;

Component型の値を取得する。

パラメーター名 説明
value 取得する値。

値を取得できた場合にtrueを返す。

public bool TryGetComponent<TComponent>(out TComponent value) ;

Component型の値を取得する。

型パラメーター名 説明 型制約
TComponent 取得するComponentの型
パラメーター名 説明
value 取得する値。

成功した場合はtrueを返す。