{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbaba-s.hatenablog.com%2Fentry%2F2019%2F11%2F28%2F120000\" title=\"\u3010Unity\u3011TryGetComponent \u306e\u6d3b\u7528\u65b9\u6cd5 - \u30b3\u30ac\u30cd\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/baba_s/","author_name":"baba_s","published":"2019-11-28 12:00:00","blog_title":"\u30b3\u30ac\u30cd\u30d6\u30ed\u30b0","height":"190","url":"https://baba-s.hatenablog.com/entry/2019/11/28/120000","version":"1.0","type":"rich","title":"\u3010Unity\u3011TryGetComponent \u306e\u6d3b\u7528\u65b9\u6cd5","width":"100%","provider_url":"https://hatena.blog","description":"\u6982\u8981 var collider = GetComponent<BoxCollider>(); if ( collider != null ) { Debug.Log( collider ); } GetComponent \u3060\u3068\u3053\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u51e6\u7406\u3092 if ( TryGetComponent<BoxCollider>( out var collider ) ) { Debug.Log( collider ); } TryGetComponent \u3092\u4f7f\u3046\u3068\u3061\u3087\u3063\u3068\u3060\u3051\u7c21\u6f54\u306b\u8a18\u8ff0\u3067\u304d\u308b \u95a2\u9023\u8a18\u4e8b","blog_url":"https://baba-s.hatenablog.com/","provider_name":"Hatena Blog","categories":["Unity","\u305d\u306e\u4ed6 - \u304a\u6c17\u306b\u5165\u308a"],"image_url":"https://cdn.user.blog.st-hatena.com/default_entry_og_image/94867065/1535279515352365"}