{"id":299,"date":"2015-03-19T12:20:15","date_gmt":"2015-03-19T03:20:15","guid":{"rendered":"http:\/\/naochang.me\/?p=299"},"modified":"2021-10-17T18:43:48","modified_gmt":"2021-10-17T09:43:48","slug":"%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%9a%e3%82%af%e3%82%bf%e3%81%a7%e3%81%aeanimationcurve%e3%81%ae%e5%88%a9%e7%94%a8","status":"publish","type":"post","link":"https:\/\/stacstar.jp\/blog\/?p=299","title":{"rendered":"\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u3067\u306eAnimationCurve\u306e\u5229\u7528"},"content":{"rendered":"<p><img decoding=\"async\" src=\"\/blog\/wp-content\/entries\/150319_AnimationCurve\/image.png\" alt=\"\" \/><\/p>\n<p>\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u4e0a\u3067<a href=\"http:\/\/docs.unity3d.com\/ja\/current\/ScriptReference\/AnimationCurve.html\" target=\"_blank\" rel=\"noopener noreferrer\">AnimationCurve<\/a>\u3092\u4f7f\u3063\u305f\u30c7\u30fc\u30bf\u306e\u5229\u7528\u3002<br \/>\n\u30b0\u30e9\u30d5\u3092\u3044\u3058\u3063\u3066\u3001<a href=\"http:\/\/docs.unity3d.com\/ja\/current\/ScriptReference\/AnimationCurve.Evaluate.html\" target=\"_blank\" rel=\"noopener noreferrer\">Evaluate(float time)<\/a>\u306b\u3066\u3001time\u306b\u5bfe\u3059\u308b\u5024\u304c\u53d6\u5f97\u3067\u304d\u308b\u3002<\/p>\n<pre class=\"brush: unitycsharp; title: ; notranslate\" title=\"\">\r\nusing UnityEngine;\r\nusing System.Collections;\r\n\r\n\/\/\/ &lt;summary&gt;\r\n\/\/\/ AnimationCurve\u306e\u30c6\u30b9\u30c8\u3002\r\n\/\/\/ &lt;\/summary&gt;\r\npublic class CurveTest : MonoBehaviour {\r\n\t\/\/\/ &lt;summary&gt;\r\n\t\/\/\/ AnimationCurve.\r\n\t\/\/\/ &lt;\/summary&gt;\r\n\t&#x5B;SerializeField]\r\n\tAnimationCurve curve;\r\n\r\n\t\/\/\/ &lt;summary&gt;\r\n\t\/\/\/ \u7d4c\u904e\u6642\u9593\u3002\r\n\t\/\/\/ &lt;\/summary&gt;\r\n\tfloat passedTime = 0f;\r\n\r\n\t\/\/\/ &lt;summary&gt;\r\n\t\/\/\/ Update.\r\n\t\/\/\/ &lt;\/summary&gt;\r\n\tvoid Update () {\r\n\t\tpassedTime += Time.deltaTime;\r\n\t\tint sec = (int)passedTime;\r\n\t\tfloat per = passedTime - sec;\r\n\r\n\t\tVector3 pos = this.transform.position;\r\n\t\tpos.x = this.curve.Evaluate(per);\r\n\t\tthis.transform.position = pos;\r\n\t}\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u4e0a\u3067AnimationCurve\u3092\u4f7f\u3063\u305f\u30c7\u30fc\u30bf\u306e\u5229\u7528\u3002 \u30b0\u30e9\u30d5\u3092\u3044\u3058\u3063\u3066\u3001Evaluate(float time)\u306b\u3066\u3001time\u306b\u5bfe\u3059\u308b\u5024\u304c\u53d6\u5f97\u3067\u304d\u308b\u3002 using UnityEngine; using Sy [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-299","post","type-post","status-publish","format-standard","hentry","category-unity"],"_links":{"self":[{"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299"}],"version-history":[{"count":4,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/299\/revisions"}],"predecessor-version":[{"id":1946,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/299\/revisions\/1946"}],"wp:attachment":[{"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}