{"id":3907,"date":"2020-09-19T09:50:05","date_gmt":"2020-09-19T00:50:05","guid":{"rendered":"https:\/\/nantoka.filmm.info\/blog\/?p=3907"},"modified":"2022-12-13T12:23:15","modified_gmt":"2022-12-13T03:23:15","slug":"waypointagent-cs-%e3%81%ae%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88","status":"publish","type":"post","link":"https:\/\/nantoka.filmm.info\/blog\/?p=3907","title":{"rendered":"WaypointAgent.cs \u306e\u30b9\u30af\u30ea\u30d7\u30c8"},"content":{"rendered":"\n<p>\u4ee5\u4e0bGit\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/gist.github.com\/tsubaki\/7e22cec8527c534e4c7a\n<\/div><\/figure>\n\n\n\n<p>\u53f3\u4e0a\u306eRaw\u3092\u62bc\u3059\u3068\u30bd\u30fc\u30b9\u304c\u3067\u3066\u304d\u307e\u3059\u306e\u3067\u3001\u63d0\u793a\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u540dWaypointAgent.cs \u3067\u4fdd\u5b58<\/p>\n\n\n\n<p>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/p>\n\n\n\n<pre class=\"wp-block-code\">\n\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;height:300px;\"><div class=\"text codecolorer\">using UnityEngine;<br \/>\nusing System.Collections;<br \/>\nusing UnityStandardAssets.Utility;<br \/>\n<br \/>\n[RequireComponent(typeof(WaypointProgressTracker))]<br \/>\npublic class WaypointAgent : MonoBehaviour <br \/>\n{<br \/>\n&nbsp; &nbsp; private WaypointProgressTracker tracker = null;<br \/>\n<br \/>\n&nbsp; &nbsp; [SerializeField, Range(0, 10)]<br \/>\n&nbsp; &nbsp; protected float speed = 1;<br \/>\n<br \/>\n&nbsp; &nbsp; void Start()<br \/>\n&nbsp; &nbsp; {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; tracker = GetComponent&amp;lt;WaypointProgressTracker&amp;gt;();<br \/>\n&nbsp; &nbsp; }<br \/>\n<br \/>\n&nbsp; &nbsp; void Update()<br \/>\n&nbsp; &nbsp; {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Vector3 targetPosition = tracker.progressPoint.position + tracker.progressPoint.direction;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; transform.position = Vector3.MoveTowards( transform.position, targetPosition, speed * Time.deltaTime);<br \/>\n&nbsp; &nbsp; }<br \/>\n}<\/div><\/div>\n\n<\/pre>\n\n\n\n<p>\u89e3\u8aac\u52d5\u753b<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Unity\u306eStandard Assets\u3068Git\u306b\u3042\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u5de1\u56de\u3092\u5b9f\u88c5\" width=\"474\" height=\"267\" src=\"https:\/\/www.youtube.com\/embed\/EIqJtX7WpBs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0bGit\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002 \u53f3\u4e0a\u306eRaw\u3092\u62bc\u3059\u3068\u30bd\u30fc\u30b9\u304c\u3067\u3066\u304d\u307e\u3059\u306e\u3067\u3001\u63d0\u793a\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u540dWaypointAgent.cs \u3067\u4fdd\u5b58 \u30d0\u30c3\u30af\u30a2\u30c3\u30d7 \u89e3\u8aac\u52d5\u753b<\/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-3907","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\/3907","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=3907"}],"version-history":[{"count":4,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3907\/revisions"}],"predecessor-version":[{"id":4229,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3907\/revisions\/4229"}],"wp:attachment":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}