「Unity/Csharp/TryGetComponent」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==サンプル== <pre> if (gameObject.TryGetComponent<TextMeshProUGUI>(out var textPro)) { textPro.text = "hoge"; } </pre> 参考:https://zenn.dev/fuqunaga/articl...」) |
(相違点なし)
|
2022年7月21日 (木) 06:05時点における版
サンプル
if (gameObject.TryGetComponent<TextMeshProUGUI>(out var textPro)) { textPro.text = "hoge"; }