{"id":693,"date":"2015-09-29T06:20:36","date_gmt":"2015-09-28T21:20:36","guid":{"rendered":"http:\/\/nantoka.filmm.info\/blog\/?p=693"},"modified":"2015-09-29T06:20:36","modified_gmt":"2015-09-28T21:20:36","slug":"%e3%82%ad%e3%83%a3%e3%83%a9%e9%81%b8%e3%81%97%e3%81%9f%e8%89%b2%e3%82%92%e3%82%ad%e3%83%a3%e3%83%a9%e3%81%ab%e4%b8%8e%e3%81%88%e3%82%8b","status":"publish","type":"post","link":"https:\/\/nantoka.filmm.info\/blog\/?p=693","title":{"rendered":"\u30ad\u30e3\u30e9\u9078\u3057\u305f\u8272\u3092\u30ad\u30e3\u30e9\u306b\u4e0e\u3048\u308b"},"content":{"rendered":"<p>\u8aac\u660e\uff08\u7565\uff09<\/p>\n<p>\u30ad\u30e3\u30e9\u306e\u6570\u3058\u3083\u306a\u304f\u8272\u3092\u63db\u3048\u308b\u3053\u3068\u3067\u9078\u629e\u5e45\u3092\u5897\u3084\u3057\u3066\u308b<\/p>\n<p>\u3082\u3061\u308d\u3093\uff0c\u30ad\u30e3\u30e9\u81ea\u8eab\u3082\u5909\u3048\u3089\u308c\u308b\u304c\u305d\u306e\u5834\u5408\u306fresorce\u3042\u305f\u308a\u3092\u4f7f\u3046\u3068\u3044\u3051\u308b\u306f\u305a<\/p>\n<p>Playerprefs\u306b\u5165\u308c\u305f\u30ad\u30e3\u30e9\u540d\u304b\u3089\u8272\u3092\u6c7a\u3081\u3066\u30a2\u30b5\u30a4\u30f3\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/p>\n<pre class=\"lang:default decode:true \" title=\"setMaterial\">using UnityEngine;\r\nusing System.Collections;\r\n\r\npublic class setMaterial : MonoBehaviour {\r\n\r\n\t\/\/\u5909\u6570\u5ba3\u8a00\r\n\tpublic Renderer myIka;\r\n\tpublic Renderer myTako;\r\n\r\n\tprivate string matname1;\r\n\tprivate string matname2;\r\n\r\n\tvoid Start () {\r\n\t\tmaterialSet (); \/\/\u9762\u5012\u304f\u3055\u3044\u3093\u3067\u4e0b\u306bfunction\u4f5c\u3063\u3066\u547c\u3073\u51fa\u3059\u3053\u3068\u306b\r\n\t}\r\n\t\r\n\t\/\/ Update is called once per frame\r\n\tvoid Update () {\r\n\t\r\n\t}\r\n\r\n\t\r\n\tvoid materialSet(){ \/\/\u3068\u3044\u3046function\u4f5c\u3063\u305f\r\n\t\tmatname1 = PlayerPrefs.GetString(\"matName1\"); \/\/\u8ddd\u96e2\u304b\u3089\u5f97\u3089\u308c\u305f\u30ad\u30e3\u30e9\u306e\u540d\u524d\u3092PlayerPrefs\u306b\u5165\u308c\u3042\u3063\u3066\uff0c\u305d\u308c\u3092\u547c\u3073\u51fa\u3059\r\n\t\tmatname2 = PlayerPrefs.GetString(\"matName2\"); \r\n\t\t\/\/PlayerPrefs\u306f\u30b7\u30fc\u30f3\u9077\u79fb\u3067\u4f7f\u3046\u306e\u304c\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\r\n\r\n\t\tmyIka = GameObject.Find(\"ikaName\").GetComponent&lt;Renderer&gt;(); \/\/\u540d\u524d\u3067\u30ad\u30e3\u30e9\u3092\u63a2\u3057\u305d\u306e\u30ec\u30f3\u30c0\u30e9\u30fc\u3092myIka\u306b\u5165\u308c\u308b\r\n\t\tmyTako = GameObject.Find(\"takoName\").GetComponent&lt;Renderer&gt;();\r\n\r\n\t\t\/\/\u30a2\u30b5\u30a4\u30f3\u3055\u308c\u3066\u3044\u308b\u30de\u30c6\u30ea\u30a2\u30eb\u306e\u8272\u3092\u8272\u540d\u3067\u5909\u66f4\uff0e\u305f\u3076\u3093Hex\u3082\u4f7f\u3048\u308b\u306f\u305a\r\n\t\t\/\/4\u629e\u3060\u3063\u305f\u306e\u3067\u30b3\u30d4\u30da\uff0ecase\u3068\u304b\u4f7f\u3063\u305f\u65b9\u304c\u3082\u3063\u3068\u30ad\u30ec\u30a4\u306b\u306a\u308b\u306e\u3060\u308d\u3046\u3051\u3069\uff0c\uff0c\r\n\t\tif (matname1 == \"ika01\") {\r\n\t\t\tmyIka.material.SetColor(\"_Color\", Color.blue);\r\n\t\t}\r\n\t\tif (matname1 == \"ika02\") {\r\n\t\t\tmyIka.material.SetColor(\"_Color\", Color.green);\r\n\t\t}\r\n\t\tif (matname1 == \"ika03\") {\r\n\t\t\tmyIka.material.SetColor(\"_Color\", Color.white);\r\n\t\t}\r\n\t\tif (matname1 == \"ika04\") {\r\n\t\t\tmyIka.material.SetColor(\"_Color\", Color.yellow);\r\n\t\t}\r\n\r\n\t\t\/\/tako\u7528\r\n\t\tif (matname2 == \"tako01\") {\r\n\t\t\tmyTako.material.SetColor(\"_Color\", Color.blue);\r\n\t\t}\r\n\t\tif (matname2 == \"tako02\") {\r\n\t\t\tmyTako.material.SetColor(\"_Color\", Color.green); \r\n\t\t}\r\n\t\tif (matname2 == \"tako03\") {\r\n\t\t\tmyTako.material.SetColor(\"_Color\", Color.white); \r\n\t\t}\r\n\t\tif (matname2 == \"tako04\") {\r\n\t\t\tmyTako.material.SetColor(\"_Color\", Color.yellow); \r\n\t\t}\r\n\r\n\t}\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8aac\u660e\uff08\u7565\uff09 \u30ad\u30e3\u30e9\u306e\u6570\u3058\u3083\u306a\u304f\u8272\u3092\u63db\u3048\u308b\u3053\u3068\u3067\u9078\u629e\u5e45\u3092\u5897\u3084\u3057\u3066\u308b \u3082\u3061\u308d\u3093\uff0c\u30ad\u30e3\u30e9\u81ea\u8eab\u3082\u5909\u3048\u3089\u308c\u308b\u304c\u305d\u306e\u5834\u5408\u306fresorce\u3042\u305f\u308a\u3092\u4f7f\u3046\u3068\u3044\u3051\u308b\u306f\u305a Playerprefs\u306b\u5165\u308c\u305f\u30ad\u30e3\u30e9\u540d\u304b\u3089\u8272\u3092\u6c7a\u3081\u3066\u30a2\u30b5\u30a4\u30f3\u3059\u308b\u30b9\u30af\u30ea &hellip; <a href=\"https:\/\/nantoka.filmm.info\/blog\/?p=693\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30ad\u30e3\u30e9\u9078\u3057\u305f\u8272\u3092\u30ad\u30e3\u30e9\u306b\u4e0e\u3048\u308b<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,2],"tags":[],"class_list":["post-693","post","type-post","status-publish","format-standard","hentry","category-c","category-unity"],"_links":{"self":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=693"}],"version-history":[{"count":1,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/693\/revisions"}],"predecessor-version":[{"id":694,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/693\/revisions\/694"}],"wp:attachment":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}