{"id":1538,"date":"2017-03-04T13:51:47","date_gmt":"2017-03-04T04:51:47","guid":{"rendered":"http:\/\/www.digifie.jp\/blog\/?p=1538"},"modified":"2017-03-04T13:59:29","modified_gmt":"2017-03-04T04:59:29","slug":"unity-%e3%83%97%e3%83%ac%e3%83%bc%e3%83%a4%e3%83%bc%e3%82%aa%e3%83%96%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%81%8c%e4%bb%96%e3%81%ae%e3%82%aa%e3%83%96%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%81%ab","status":"publish","type":"post","link":"https:\/\/www.digifie.jp\/blog\/archives\/1538","title":{"rendered":"Unity \u30d7\u30ec\u30fc\u30e4\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u96a0\u308c\u305f\u6642\u3067\u3082\u898b\u3048\u308b\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_facebook\"><a href='http:\/\/www.facebook.com\/share.php?u=https%3A%2F%2Fwww.digifie.jp%2Fblog%2Farchives%2F1538&t=Unity%20%E3%83%97%E3%83%AC%E3%83%BC%E3%83%A4%E3%83%BC%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%81%8C%E4%BB%96%E3%81%AE%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%81%AB%E9%9A%A0%E3%82%8C%E3%81%9F%E6%99%82%E3%81%A7%E3%82%82%E8%A6%8B%E3%81%88%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B' title='Facebook \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='https:\/\/www.digifie.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/facebook.png' alt='Facebook \u306b\u30b7\u30a7\u30a2' title='Facebook \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.digifie.jp\/blog\/archives\/1538\" data-text=\"Unity \u30d7\u30ec\u30fc\u30e4\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u96a0\u308c\u305f\u6642\u3067\u3082\u898b\u3048\u308b\u3088\u3046\u306b\u3059\u308b\" data-via=\"LLC DigiFie\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.digifie.jp\/blog\/wp-content\/uploads\/2017\/03\/ray_test.png\" alt=\"\" width=\"900\" height=\"563\" class=\"aligncenter size-full wp-image-1539\" srcset=\"https:\/\/www.digifie.jp\/blog\/wp-content\/uploads\/2017\/03\/ray_test.png 900w, https:\/\/www.digifie.jp\/blog\/wp-content\/uploads\/2017\/03\/ray_test-300x188.png 300w, https:\/\/www.digifie.jp\/blog\/wp-content\/uploads\/2017\/03\/ray_test-768x480.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u304c\u3084\u305f\u3089\u3068\u9577\u3044\u3067\u3059\u304c\u2026<\/p>\n<p>\u30d7\u30ec\u30fc\u30e4\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30ab\u30e1\u30e9\u3067\u8ffd\u3063\u3066\u3044\u308b\u6642\u3001\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30ab\u30e1\u30e9\u3068\u30d7\u30ec\u30fc\u30e4\u30fc\u306e\u9593\u306b\u5165\u3063\u3066\u3057\u307e\u3046\u3068\u30d7\u30ec\u30fc\u30e4\u30fc\u304c\u898b\u3048\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3001\u3053\u306e\u305b\u3044\u3067\u306a\u3093\u3060\u304b\u30e2\u30e4\u30e2\u30e4\u3059\u308b\u306e\u3092\u89e3\u6d88\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>\u30b2\u30fc\u30e0\u306a\u3069\u3067\u306f\u3088\u304f\u3001\u80cc\u9762\u306b\u96a0\u308c\u3066\u3044\u3066\u3082Z\u6df1\u5ea6\u30c6\u30b9\u30c8\u3092\u5408\u683c\u3055\u305b\u3066\u3001\u30b9\u30c6\u30f3\u30b7\u30eb\u30d0\u30c3\u30d5\u30a1\u306b\u66f8\u304d\u8fbc\u3093\u3067\u524d\u9762\u306b\u8868\u793a\u3055\u308b\u65b9\u6cd5\u304c\u3068\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u3088\u308a\u3082\u3063\u3068\u30b7\u30f3\u30d7\u30eb\u306a\u65b9\u6cd5\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u3001\u3069\u3046\u3084\u3063\u305f\u304b\u3068\u3044\u3046\u3068\u2026<\/p>\n<p>\u307e\u305a\u3001\u30ab\u30e1\u30e9\u304b\u3089\u30d7\u30ec\u30fc\u30e4\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b Ray \u3092\u98db\u3070\u3057\u307e\u3059\u3002<br \/>\n\u30ab\u30e1\u30e9\u3068\u30d7\u30ec\u30fc\u30e4\u30fc\u306e\u9593\u306b\u969c\u5bb3\u306b\u306a\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u306a\u3044\u3068\u304d\u306f Rey \u306f\u30d7\u30ec\u30fc\u30e4\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5f53\u305f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3068\u3053\u308d\u304c\u3001\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30ab\u30e1\u30e9\u3068\u30d7\u30ec\u30fc\u30e4\u30fc\u306e\u9593\u306b\u5165\u3063\u305f\u5834\u5408\u3001Ray \u306f\u30d7\u30ec\u30fc\u30e4\u30fc\u3067\u306f\u306a\u304f\u9593\u306b\u3042\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5f53\u305f\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u2026<br \/>\n\u3053\u306e RayHit \u5bfe\u8c61\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u534a\u900f\u660e\u306b\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u65b9\u6cd5\u3067\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ Ray\r\nprotected Ray _ray;\r\nprotected RaycastHit _rayhit;\r\n\r\n\/\/ \u30a8\u30c7\u30a3\u30bf\u3067\u901a\u5e38\u6642\u306e\u30b7\u30a7\u30fc\u30c0\u3068\u900f\u660e\u7528\u306e\u30b7\u30a7\u30fc\u30c0\u3092\u6307\u5b9a\u3059\u308b\r\npublic Shader defaultShader; \/\/ \u901a\u5e38\u6642\r\npublic Shader alphaShader; \/\/ \u900f\u660e\u6642\r\n\r\nvoid Update()\r\n{\r\n\t_ray = new Ray (mainCamera.transform.position, -(mainCamera.transform.position - playerObject.transform.position));\r\n\tif (Physics.Raycast (_ray, out _rayhit)) {\r\n\t\tif (_rayhit.collider.tag == &quot;RayTarget&quot;) {\r\n\t\t\t\/\/ Ray \u304c\u5f53\u305f\u3063\u3066\u3044\u308b\u9593\u306f\u5bfe\u8c61\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b7\u30a7\u30fc\u30c0\u3092 alphaShader \u306b\u3059\u308b\r\n\t\t\tShader targetShader = _rayhit.collider.gameObject.GetComponent&lt;Renderer&gt; ().material.shader;\r\n\t\t\tif(targetShader != alphaShader)\r\n\t\t\t{\r\n\t\t\t\ttargetShader = alphaShader;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\/\/ Ray \u304c\u5f53\u305f\u3063\u3066\u3044\u306a\u3044\u6642\u306f defaultShader \u306b\u623b\u3059\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067\u306f\u7d30\u304b\u3044\u3068\u3053\u308d\u306f\u7701\u7565\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u57fa\u672c\u7684\u306a\u51e6\u7406\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u884c\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3067\u3001\u30d7\u30ec\u30fc\u30e4\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5411\u3053\u3046\u5074\u306b\u96a0\u308c\u3066\u3082\u898b\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u306e\u52d5\u4f5c\u306f\u3053\u3093\u306a\u611f\u3058\u3002<br \/>\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/P_g7ABspyG0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>\u3061\u306a\u307f\u306b\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u900f\u660e\u7528\u306e\u30b7\u30a7\u30fc\u30c0\u3068\u3057\u3066\u3001<a href=\"http:\/\/www.digifie.jp\/blog\/archives\/1527\">\u5148\u65e5\u8a18\u4e8b\u3092\u66f8\u3044\u305f\u534a\u900f\u660e\u30ea\u30e0\u30e9\u30a4\u30c8\u30b7\u30a7\u30fc\u30c0<\/a>\u306b\u30ce\u30fc\u30de\u30eb\uff08\u30d0\u30f3\u30d7\uff09\u30de\u30c3\u30d7\u3092\u8ffd\u52a0\u3057\u305f\u3082\u306e\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_facebook\"><a href='http:\/\/www.facebook.com\/share.php?u=https%3A%2F%2Fwww.digifie.jp%2Fblog%2Farchives%2F1538&t=Unity%20%E3%83%97%E3%83%AC%E3%83%BC%E3%83%A4%E3%83%BC%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%81%8C%E4%BB%96%E3%81%AE%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%81%AB%E9%9A%A0%E3%82%8C%E3%81%9F%E6%99%82%E3%81%A7%E3%82%82%E8%A6%8B%E3%81%88%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B' title='Facebook \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='https:\/\/www.digifie.jp\/blog\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/facebook.png' alt='Facebook \u306b\u30b7\u30a7\u30a2' title='Facebook \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.digifie.jp\/blog\/archives\/1538\" data-text=\"Unity \u30d7\u30ec\u30fc\u30e4\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u96a0\u308c\u305f\u6642\u3067\u3082\u898b\u3048\u308b\u3088\u3046\u306b\u3059\u308b\" data-via=\"LLC DigiFie\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u304c\u3084\u305f\u3089\u3068\u9577\u3044\u3067\u3059\u304c\u2026 \u30d7\u30ec\u30fc\u30e4\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30ab\u30e1\u30e9\u3067\u8ffd\u3063\u3066\u3044\u308b\u6642\u3001\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30ab\u30e1\u30e9\u3068\u30d7\u30ec\u30fc\u30e4\u30fc\u306e\u9593\u306b\u5165\u3063\u3066\u3057\u307e\u3046\u3068\u30d7\u30ec\u30fc\u30e4\u30fc\u304c\u898b\u3048\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3001\u3053\u306e\u305b\u3044\u3067\u306a\u3093\u3060\u304b\u30e2\u30e4\u30e2\u30e4\u3059\u308b\u306e\u3092\u89e3\u6d88\u3059\u308b\u65b9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[32],"tags":[],"_links":{"self":[{"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/posts\/1538"}],"collection":[{"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/comments?post=1538"}],"version-history":[{"count":6,"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/posts\/1538\/revisions"}],"predecessor-version":[{"id":1545,"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/posts\/1538\/revisions\/1545"}],"wp:attachment":[{"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/media?parent=1538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/categories?post=1538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.digifie.jp\/blog\/wp-json\/wp\/v2\/tags?post=1538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}