{"id":1565,"date":"2016-07-12T10:45:50","date_gmt":"2016-07-12T01:45:50","guid":{"rendered":"http:\/\/nantoka.filmm.info\/blog\/?p=1565"},"modified":"2017-07-10T14:52:24","modified_gmt":"2017-07-10T05:52:24","slug":"%e5%a4%96%e9%83%a8%e3%82%bb%e3%83%b3%e3%82%b5%e3%81%ae%e5%85%a5%e5%8a%9b%e9%96%93%e9%9a%94%e3%82%92%e9%80%9f%e5%ba%a6%e3%81%ab%e5%a4%89%e6%9b%b4","status":"publish","type":"post","link":"https:\/\/nantoka.filmm.info\/blog\/?p=1565","title":{"rendered":"\u5916\u90e8\u30bb\u30f3\u30b5\u306e\u5165\u529b\u9593\u9694\u3092\u901f\u5ea6\u306b\u5909\u66f4"},"content":{"rendered":"<p>\u203b\u73fe\u5728\u306f\u3053\u306e\u65b9\u6cd5\u306f\u4f7f\u7528\u3057\u3066\u3044\u307e\u305b\u3093\uff0eArduino\u5185\u30671\u5468\u306b\u304b\u304b\u308bms\u3092\u691c\u51fa\u3057\uff0c\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067\u305d\u306e\u6570\u5024\u3092Unity\u306b\u9001\u4fe1\u3057\u3066\u3044\u307e\u3059\uff08\u73fe\u5728\u306e\u65b9\u6cd5\u306f<a href=\"http:\/\/nantoka.filmm.info\/blog\/?p=1651\">\u3053\u3061\u3089<\/a>\uff09<\/p>\n<p>\u81ea\u8ee2\u8eca\u306e\u901f\u5ea6\u8a08\u306e\u3088\u3046\u306b\uff0c\u5186\u5468n\u306e\u30bf\u30a4\u30e4\u304c1\u5468\u3059\u308b\u306e\u306b\u4f55\u79d2\u304b\u304b\u3063\u305f\u304b\u3067\uff0c\u6642\u901f\u3092\u8a08\u6e2c\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\uff0e<\/p>\n<p>\u4f59\u8ac7\u3067\u3059\u304c\uff0c\u3053\u308c\u306f\u30b2\u30fc\u30e0\u5185\u306e\u901f\u5ea6\u3067\u306f\u306a\u304f\uff0c\u5b9f\u969b\u306b\u5916\u90e8\u306e\u30c7\u30d0\u30a4\u30b9\u306e\u901f\u5ea6\u3092\u8a08\u7b97\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\uff0e<\/p>\n<p>\u306a\u304a\uff0cUnity\u5185\u306e\u901f\u5ea6\u306f\uff11\u30e6\u30cb\u30c3\u30c81\uff4d\u3067\u8a08\u7b97\u3059\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\uff0e<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">using UnityEngine;\r\nusing System;\/\/\u6642\u9593\u8a08\u6e2c\u3059\u308b\u306e\u306b\u5fc5\u8981\r\n\r\npublic class mySpline : MonoBehaviour\r\n{\r\n\r\n\t\/\/\u6642\u9593\u8a08\u6e2c\u306b\u5fc5\u8981\u306a\u5909\u6570\r\n\tprivate int starttime; \/\/\u6700\u521d\u306e\u521d\u671f\u5024\u7528\r\n\tprivate int now; \/\/\u73fe\u5728\u306e\u6642\u9593\u3092\u683c\u7d0d\u3059\u308b\u7528\r\n\tprivate int duration; \/\/\u7d4c\u904e\u6642\u9593\u3092\u683c\u7d0d\u3059\u308b\u7528\r\n\r\n\tvoid Start(){\r\n\r\n\t\tstarttime = DateTime.Now.Hour * 60 *60 * 1000 + DateTime.Now.Minute * 60 * 1000 + DateTime.Now.Second * 1000 + DateTime.Now.Millisecond;\r\n\t\t\/\/\u30b2\u30fc\u30e0\u30b9\u30bf\u30fc\u30c8\u6642\u306e\u6642\u523b\u3092\u30df\u30ea\u30bb\u30ab\u30f3\u30c9\u306b\u5909\u63db\u3057\u3066starttime\u306b\u683c\u7d0d\u3057\u307e\u3059\r\n\t}\r\n\r\n\r\n\tpublic void cycle1(){ \/\/1\u5468\u3054\u3068\u306b\u30bb\u30f3\u30b5\u30fc\u306a\u3069\u3067\u3053\u306e\u95a2\u6570\u3092\u547c\u3073\u307e\u3059\uff0epublic\u306b\u3057\u3066\u3042\u308b\u306e\u306f\uff0c\u30c6\u30b9\u30c8\u7528\u306bGUI\u30dc\u30bf\u30f3\u3067\u547c\u3079\u308b\u3088\u3046\u306b\u3057\u3066\u308b\r\n\t\tnow = DateTime.Now.Hour * 60 *60 * 1000 + DateTime.Now.Minute * 60 * 1000 + DateTime.Now.Second * 1000 + DateTime.Now.Millisecond; \/\/\u3053\u306e\u95a2\u6570\u304c\u547c\u3070\u308c\u305f\u6642\u306e\u6642\u9593\u3092\u30df\u30ea\u30bb\u30ab\u30f3\u30c9\u306b\u3057\u3066\u683c\u7d0d\r\n\t\tduration = now - starttime; \/\/\u7d4c\u904e\u6642\u9593\u3092\u7b97\u51fa\u3057\u3066duration\u306b\u683c\u7d0d\r\n\t\tfloat myspeed = (3600000f \/ duration) * 0.00062f; \/\/\u5186\u54680.00062km\uff08\u3064\u307e\u308a62cm\uff09\u3068\u7d4c\u904e\u6642\u9593\u3067\u6642\u901f\u3092\u8a08\u7b97\u3057\uff0c\u30ed\u30fc\u30ab\u30eb\u5909\u6570myspeed\u306b\u683c\u7d0d\u3059\u308b\r\n\t\tstring kmspeed = myspeed.ToString (\"N2\"); \/\/myspeed\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\uff0c\u305f\u3060\u3057\u5c0f\u6570\u70b92\u6841\u307e\u3067\u3067\u5207\u308a\u6368\u3066\u3066\uff0c\u6587\u5b57\u7528\u30ed\u30fc\u30ab\u30eb\u5909\u6570kmspeed\u306b\u683c\u7d0d\uff0e\u6587\u5b57\u5217\u306b\u5909\u66f4\u3057\u3066\u3044\u308b\u306e\u306f\uff27\uff35\uff29\u306b\u3059\u3050\u3044\u308c\u3089\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\r\n\t\t\tDebug.Log (kmspeed + \"km\/h\");\/\/\u30b3\u30f3\u30bd\u30fc\u30eb\u753b\u9762\u306b\u901f\u5ea6\u3068\u5358\u4f4dKm\/h\u3092\u8ffd\u52a0\u3057\u3066\u8868\u793a\r\n\t\tstarttime = DateTime.Now.Hour * 60 *60 * 1000 + DateTime.Now.Minute * 60 * 1000 + DateTime.Now.Second * 1000 + DateTime.Now.Millisecond;\/\/\u6b21\u306e\u8a08\u6e2c\u958b\u59cb\u7528\u306bstarttime\u306e\u6642\u9593\u3092\u73fe\u5728\u6642\u9593\u306b\u66f4\u65b0\r\n\r\n\t}\r\n\r\n}<\/pre>\n<p><a href=\"http:\/\/nantoka.filmm.info\/blog\/wp-content\/uploads\/2016\/07\/speedscreen.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1567\" src=\"http:\/\/nantoka.filmm.info\/blog\/wp-content\/uploads\/2016\/07\/speedscreen.jpg\" alt=\"speedscreen\" width=\"250\" height=\"500\" srcset=\"https:\/\/nantoka.filmm.info\/blog\/wp-content\/uploads\/2016\/07\/speedscreen.jpg 250w, https:\/\/nantoka.filmm.info\/blog\/wp-content\/uploads\/2016\/07\/speedscreen-150x300.jpg 150w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>\u3068\u3053\u308d\u3067\uff0cUnity\u306e\u8a08\u7b97\u9593\u9694\u3092\u8d85\u3048\u305f\u5834\u5408\u3063\u3066\u3069\u3046\u306a\u308b\u3093\u3067\u3057\u3087\u3046\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u203b\u73fe\u5728\u306f\u3053\u306e\u65b9\u6cd5\u306f\u4f7f\u7528\u3057\u3066\u3044\u307e\u305b\u3093\uff0eArduino\u5185\u30671\u5468\u306b\u304b\u304b\u308bms\u3092\u691c\u51fa\u3057\uff0c\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067\u305d\u306e\u6570\u5024\u3092Unity\u306b\u9001\u4fe1\u3057\u3066\u3044\u307e\u3059\uff08\u73fe\u5728\u306e\u65b9\u6cd5\u306f\u3053\u3061\u3089\uff09 \u81ea\u8ee2\u8eca\u306e\u901f\u5ea6\u8a08\u306e\u3088\u3046\u306b\uff0c\u5186\u5468n\u306e\u30bf\u30a4\u30e4\u304c1\u5468\u3059\u308b\u306e\u306b\u4f55\u79d2\u304b\u304b\u3063\u305f\u304b &hellip; <a href=\"https:\/\/nantoka.filmm.info\/blog\/?p=1565\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u5916\u90e8\u30bb\u30f3\u30b5\u306e\u5165\u529b\u9593\u9694\u3092\u901f\u5ea6\u306b\u5909\u66f4<\/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-1565","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\/1565","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=1565"}],"version-history":[{"count":5,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1565\/revisions"}],"predecessor-version":[{"id":2427,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1565\/revisions\/2427"}],"wp:attachment":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}