{"id":886,"date":"2016-04-13T19:04:44","date_gmt":"2016-04-13T10:04:44","guid":{"rendered":"http:\/\/nantoka.filmm.info\/blog\/?p=886"},"modified":"2016-04-13T19:05:13","modified_gmt":"2016-04-13T10:05:13","slug":"%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e4%ba%8b%e4%be%8b%e3%83%bc%e3%82%af%e3%82%a4%e3%82%ba%e4%b8%ad%e3%81%ae%e7%b5%8c%e9%81%8e%e6%99%82%e9%96%93%e8%a1%a8%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/nantoka.filmm.info\/blog\/?p=886","title":{"rendered":"\u30b9\u30af\u30ea\u30d7\u30c8\u4e8b\u4f8b\u30fc\u30af\u30a4\u30ba\u4e2d\u306e\u7d4c\u904e\u6642\u9593\u8868\u793a"},"content":{"rendered":"<p>static\u3067\u5909\u6570\u3092\u30b0\u30ed\u30fc\u30d0\u30eb\u5316\u3057\u3066\u3044\u308b\u3051\u3069\uff0c\u3053\u308c\u306f\u4f7f\u7528\u3057\u305f\u306e\u304b\u4e0d\u660e\uff0e<\/p>\n<p>lapTime\u306ebool\u3092On\/Off\u3057\u3066\u3066\uff0c\u30dd\u30fc\u30ba\u4e2d\u306f\u6642\u9593\u7d4c\u904e\u3092\u30b9\u30eb\u30fc <em> if(false)\u3000\u3055\u305b\u3066\u3044\u308b\uff0e<\/em><\/p>\n<p>\u30dd\u30fc\u30ba\u4e2d\u306f\u8272\u3092\u70b9\u6ec5\uff1d\u3000\u30b3\u30eb\u30fc\u30c1\u30f3\u306ecolorSwitch()\u306e\u3068\u3053<\/p>\n<p>\u3053\u308c\uff0ccolorSwitch()\u306e\u30b3\u30eb\u30fc\u30c1\u30f3\u3092\u6b62\u3081\u3066\u3044\u306a\u3044\u3063\u307d\u3044\u3093\u3067\uff0c7\u554f\u3060\u304b\u3089\u3044\u3044\u3051\u3069\uff0c\u30dd\u30fc\u30ba\u4ee5\u5916\u306f\u30b3\u30eb\u30fc\u30c1\u30f3\u6b62\u3081\u305f\u307b\u3046\u304c\u3044\u3044\u304b\u3082\uff0e<\/p>\n<pre class=\"lang:default decode:true \">using UnityEngine;\r\nusing System.Collections;\r\nusing System;\r\nusing UnityEngine.UI;\r\n\r\n\r\npublic class qwach : MonoBehaviour {\r\n\r\n\tpublic static float Quiztime = 0;\/\/read from global\r\n\tpublic GameObject startPanel;\r\n\tpublic GameObject startKaitou;\r\n\r\n\tpublic Text timeTex; \/\/Text\u7528\u5909\u6570\r\n\tprivate bool lapTime;\r\n\r\n\r\n\t\/\/ Use this for initialization\r\n\tvoid Start () {\r\n\t\tQuiztime = 0f;\r\n\t\tstartPanel.SetActive (true);\r\n\t\tlapTime = false;\r\n\t\ttimeTex.color = Color.grey;\r\n\t}\r\n\r\n\tvoid Awake(){\r\n\r\n\t\t\/\/StartCoroutine (\"colorSwitch\");\r\n\t}\r\n\r\n\t\/\/ Update is called once per frame\r\n\tvoid Update () {\r\n\r\n\t\tif (lapTime) {\r\n\t\t\tQuiztime += Time.deltaTime;\r\n\t\t\ttimeTex.text = Quiztime.ToString (\"f2\") + \"\u79d2\u7d4c\u904e\";\r\n\t\t\t;\r\n\t\t\t\/\/timeTex.text = timeTex + \"\u79d2\u7d4c\u904e\";\r\n\t\t\t\/\/Debug.Log (time.ToString ());\r\n\t\t} else {\r\n\t\t\t\/\/pause syori\r\n\t\t\t\/\/StartCoroutine(\"colorSwitch\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\r\n\t}\r\n\r\n\tprivate IEnumerator colorSwitch(){\r\n\t\twhile (true) {\r\n\t\r\n\t\t\t\ttimeTex.color = Color.grey;\r\n\t\t\t\tyield return new WaitForSeconds (0.5f);\r\n\t\t\t\ttimeTex.color = Color.white;\r\n\t\t\t\tyield return new WaitForSeconds (0.5f);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tpublic void qwPause(){\r\n\t\tStartCoroutine (\"colorSwitch\");\r\n\t\tlapTime = false;\r\n\t}\r\n\r\n\tpublic void qwStart(){\r\n\t\tStopCoroutine (\"colorSwitch\");\r\n\t\ttimeTex.color = Color.white;\r\n\t\tlapTime = true;\r\n\t}\r\n\r\n\r\n\tpublic void qStart(){\r\n\t\tlapTime = true;\r\n\t\tstartPanel.SetActive (false);\r\n\t\ttimeTex.color = Color.white;\r\n\r\n\t\tstartKaitou.SetActive (true);\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>static\u3067\u5909\u6570\u3092\u30b0\u30ed\u30fc\u30d0\u30eb\u5316\u3057\u3066\u3044\u308b\u3051\u3069\uff0c\u3053\u308c\u306f\u4f7f\u7528\u3057\u305f\u306e\u304b\u4e0d\u660e\uff0e lapTime\u306ebool\u3092On\/Off\u3057\u3066\u3066\uff0c\u30dd\u30fc\u30ba\u4e2d\u306f\u6642\u9593\u7d4c\u904e\u3092\u30b9\u30eb\u30fc if(false)\u3000\u3055\u305b\u3066\u3044\u308b\uff0e \u30dd\u30fc\u30ba\u4e2d\u306f\u8272\u3092\u70b9\u6ec5\uff1d\u3000\u30b3\u30eb\u30fc\u30c1\u30f3\u306ecol &hellip; <a href=\"https:\/\/nantoka.filmm.info\/blog\/?p=886\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30b9\u30af\u30ea\u30d7\u30c8\u4e8b\u4f8b\u30fc\u30af\u30a4\u30ba\u4e2d\u306e\u7d4c\u904e\u6642\u9593\u8868\u793a<\/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-886","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\/886","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=886"}],"version-history":[{"count":1,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions"}],"predecessor-version":[{"id":887,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions\/887"}],"wp:attachment":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}