{"id":10325,"date":"2021-08-12T10:00:51","date_gmt":"2021-08-12T01:00:51","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=10325"},"modified":"2021-08-11T15:34:41","modified_gmt":"2021-08-11T06:34:41","slug":"unity-%e3%82%ab%e3%83%a1%e3%83%a9%e3%81%ab%e8%bf%bd%e5%be%93%e3%81%99%e3%82%8bgameobject%e3%81%a8%e8%a4%87%e8%a3%bd1","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/10325","title":{"rendered":"[Unity] \u30ab\u30e1\u30e9\u306b\u8ffd\u5f93\u3059\u308bGameObject\u3068\u8907\u88fd(1)"},"content":{"rendered":"\n<p>\u4eca\u56de\u306f\u30ab\u30e1\u30e9\u306b\u8ffd\u5f93\u3059\u308bGameObject\u3068\u4efb\u610f\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067GameObject\u3092\u8907\u88fd\u3059\u308b\u65b9\u6cd5\u3092\u30b7\u30a7\u30a2\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h4>\u60f3\u5b9a\u3059\u308b\u52d5\u4f5c<\/h4>\n\n\n\n<p>1)<br> \u30ab\u30e1\u30e9\u304c\u3069\u306e\u65b9\u5411\u3092\u5411\u3044\u3066\u3082\u5e38\u306b\u753b\u9762\u4e2d\u592e\u306bGameObject\u304c\u8ffd\u5f93\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"640\" height=\"333\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2021\/08\/1.gif\" alt=\"\" class=\"wp-image-10327\"\/><\/figure>\n\n\n\n<p>\u30ab\u30e1\u30e9\u306e\u5411\u304d\u306b\u5fdc\u3058\u3066Cube\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u8ffd\u5f93\u3059\u308b\u306e\u3067\u3001\u5e38\u306b\u753b\u9762\u306e\u4e2d\u5fc3\u306bCube\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u8868\u793a\u3055\u308c\u308b(\u4e0b\u753b\u9762)\u3002<\/p>\n\n\n\n<p>2)<br> \u30b9\u30da\u30fc\u30b9\u30ad\u30fc\u3092\u62bc\u3059\u3068\u3001\u753b\u9762\u4e2d\u592e\u306bGameObject\u304c\u8907\u88fd\u3055\u308c\u3001\u30b9\u30da\u30fc\u30b9\u30ad\u30fc\u3092\u62bc\u3057\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u306e\u5834\u6240\u3067\u56fa\u5b9a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"640\" height=\"333\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2021\/08\/2.gif\" alt=\"\" class=\"wp-image-10329\"\/><\/figure>\n\n\n\n<p>\u30ab\u30e1\u30e9\u306e\u5411\u304d\u3092\u5909\u3048\u306a\u304c\u3089\u30b9\u30da\u30fc\u30b9\u30ad\u30fc\u3092\u62bc\u3059\u3068\u3001\u305d\u306e\u6642\u70b9\u3067Cube\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u8907\u88fd\u3055\u308c\u56fa\u5b9a\u5316\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h4>\u5b9f\u88c5\u65b9\u6cd5<\/h4>\n\n\n\n<p>\u30ab\u30e1\u30e9\u306e\u5411\u304d\u3092W(\u4e0a)A(\u5de6)S(\u4e0b)D(\u53f3)\u30ad\u30fc\u3067\u64cd\u4f5c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n\n\n\n<p>Assets\u5185\u306bScript\u3092\u65b0\u898f\u4f5c\u6210\u3057\u307e\u3059\u3002<br> Script\u540d\u306f\u300cRotationScript\u300d\u3068\u3057\u307e\u3057\u305f\u3002<br> \u4ee5\u4e0b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class RotationScript : MonoBehaviour\n{\n\n\n    \/\/ Update is called once per frame\n    void Update()\n    {\n        \/\/A\u30ad\u30fc\u3092\u62bc\u3057\u3066\u3044\u308b\u9593\u306fY\u8ef8\u306b1\u52a0\u7b97\u3057\u3066\u56de\u8ee2\n        if (Input.GetKey(\"a\"))\n        {\n            float x = 1;\n            this.transform.Rotate(0.0f, x, 0.0f);\n\n        }\n        \/\/D\u30ad\u30fc\u3092\u62bc\u3057\u3066\u3044\u308b\u9593\u306fY\u8ef8\u306b1\u6e1b\u7b97\u3057\u3066\u56de\u8ee2\n        if (Input.GetKey(\"d\"))\n        {\n            float x = -1;\n            this.transform.Rotate(0.0f, x, 0.0f);\n\n        }\n        \/\/W\u30ad\u30fc\u3092\u62bc\u3057\u3066\u3044\u308b\u9593\u306fY\u8ef8\u306b1\u52a0\u7b97\u3057\u3066\u56de\u8ee2\n        if (Input.GetKey(\"w\"))\n        {\n            float x = -1;\n            this.transform.Rotate(x, 0.0f, 0.0f);\n\n        }\n        \/\/S\u30ad\u30fc\u3092\u62bc\u3057\u3066\u3044\u308b\u9593\u306fY\u8ef8\u306b1\u6e1b\u7b97\u3057\u3066\u56de\u8ee2\n        if (Input.GetKey(\"s\"))\n        {\n            float x = 1;\n            this.transform.Rotate(x, 0.0f, 0.0f);\n\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u3053\u306eScript\u3092Camera\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u30a2\u30bf\u30c3\u30c1\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u30ab\u30e1\u30e9\u306e\u56de\u8ee2\u3092\u30ad\u30fc\u30dc\u30fc\u30c9\u304b\u3089\u64cd\u4f5c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6b21\u56de\u306f\u3001\u3053\u306e\u30ab\u30e1\u30e9\u306b\u8ffd\u5f93\u3059\u308bCube\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u914d\u7f6e\u3059\u308b\u65b9\u6cd5\u3068\u4efb\u610f\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067Cube\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8907\u88fd\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6728\u66dc\u65e5\u62c5\u5f53\uff1anishida<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10325\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/10325\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"[Unity] \u30ab\u30e1\u30e9\u306b\u8ffd\u5f93\u3059\u308bGameObject\u3068\u8907\u88fd(1)\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10325\" data-text=\"[Unity] \u30ab\u30e1\u30e9\u306b\u8ffd\u5f93\u3059\u308bGameObject\u3068\u8907\u88fd(1)\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10325\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10325\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306f\u30ab\u30e1\u30e9\u306b\u8ffd\u5f93\u3059\u308bGameObject\u3068\u4efb\u610f\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067GameObject\u3092\u8907\u88fd\u3059\u308b\u65b9\u6cd5\u3092\u30b7\u30a7\u30a2\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[109],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10325"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=10325"}],"version-history":[{"count":14,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10325\/revisions"}],"predecessor-version":[{"id":10343,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10325\/revisions\/10343"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=10325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=10325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=10325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}