{"id":716,"date":"2015-10-13T11:50:04","date_gmt":"2015-10-13T02:50:04","guid":{"rendered":"http:\/\/nantoka.filmm.info\/blog\/?p=716"},"modified":"2015-10-13T11:50:04","modified_gmt":"2015-10-13T02:50:04","slug":"%e3%83%86%e3%82%af%e3%82%b9%e3%83%81%e3%83%a3%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc","status":"publish","type":"post","link":"https:\/\/nantoka.filmm.info\/blog\/?p=716","title":{"rendered":"\u30c6\u30af\u30b9\u30c1\u30e3\u30ed\u30fc\u30c0\u30fc"},"content":{"rendered":"<p>\u30c6\u30af\u30b9\u30c1\u30e3\u30ed\u30fc\u30c0\u30fc<\/p>\n<pre class=\"lang:c# decode:true \">using UnityEngine;\r\nusing System.Collections;\r\nusing UnityEngine.UI; \/\/ui system use\r\nusing System.IO; \/\/file save\r\n\r\npublic class texLoader : MonoBehaviour {\r\n\r\npublic string url = \"\";\r\npublic string url2 = \".jpg\";\r\n\tpublic GameObject textArea ;\r\n\tpublic GameObject mySlider ;\r\n\tpublic GameObject plusBtn;\r\n\tpublic GameObject minusBtn;\r\n\tpublic GameObject textureObject;\r\n\tprivate WWW myurl;\r\n\tprivate int texnumberInt = 100;\/\/ 100 is first fefault number\r\n\tprivate string texnum ;\r\n\tprivate Slider slider;\r\n\t\/\/ Use this for initialization\r\n\tvoid Start () {\r\n\r\n\r\n\t\tslider = mySlider.GetComponent &lt;Slider&gt; ();\r\n\t\tslider.onValueChanged.AddListener((value) =&gt; {\r\n\t\t\ttexnum = value.ToString();\r\n\t\t});\r\n\r\n\r\n\t\ttexnum = \"\" + texnumberInt;\/\/\r\n\t\ttextArea.GetComponent&lt;Text&gt;().text = texnum;\r\n\t\tStartCoroutine (\"loadTex\");\r\n\r\n\t}\r\n\t\r\n\t\/\/ Update is called once per frame\r\n\tvoid Update () {\r\n\t\r\n\r\n\r\n\r\n\t}\r\n\r\n\r\n\tpublic void sliderval(float val){\r\n\t\ttexnum = val.ToString();\r\n\t\ttextArea.GetComponent&lt;Text&gt;().text = texnum;\r\n\r\n\t\tStartCoroutine (\"loadTex\");\r\n\t\t\/\/Debug.Log (texnum);\r\n\t}\r\n\r\n\r\n\tpublic void oneplus(){\r\n\t\tslider.value ++;\r\n\t}\r\n\r\n\tpublic void oneminus(){\r\n\t\tslider.value --;\r\n\t}\r\n\r\n\r\n\r\n\tprivate IEnumerator loadTex() {\r\n\t\tmyurl = new WWW(url + texnum + url2);\r\n\t\t\/\/Debug.Log (texnum);\r\n\t\tyield return myurl;\r\n\r\n\t\t\/\/ file write\r\n\r\n\t\t\/\/File.WriteAllBytes( Application.persistentDataPath + \"\/\" + Path.GetFileName(myurl.url), myurl.bytes );\r\n\t\tFile.WriteAllBytes( \".\/myTex\", myurl.bytes );\r\n\r\n\r\n\t\tRenderer renderer = textureObject.GetComponent&lt;Renderer&gt;();\r\n\t\trenderer.material.mainTexture = myurl.texture;\r\n\t}\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c6\u30af\u30b9\u30c1\u30e3\u30ed\u30fc\u30c0\u30fc using UnityEngine; using System.Collections; using UnityEngine.UI; \/\/ui system use using System.IO;  &hellip; <a href=\"https:\/\/nantoka.filmm.info\/blog\/?p=716\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30c6\u30af\u30b9\u30c1\u30e3\u30ed\u30fc\u30c0\u30fc<\/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-716","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\/716","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=716"}],"version-history":[{"count":1,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/716\/revisions"}],"predecessor-version":[{"id":717,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/716\/revisions\/717"}],"wp:attachment":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}