{"id":96293,"date":"2020-04-12T23:35:02","date_gmt":"2020-04-12T15:35:02","guid":{"rendered":"http:\/\/4563.org\/?p=96293"},"modified":"2020-04-12T23:35:02","modified_gmt":"2020-04-12T15:35:02","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-timeline-%e4%b8%ad%e5%88%9b%e5%bb%ba%e8%87%aa%e5%ae%9a%e4%b9%89%e8%bd%a8%e9%81%93%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=96293","title":{"rendered":"\u5982\u4f55\u5728 Timeline \u4e2d\u521b\u5efa\u81ea\u5b9a\u4e49\u8f68\u9053\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5982\u4f55\u5728 Timeline \u4e2d\u521b\u5efa\u81ea\u5b9a\u4e49\u8f68\u9053\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : unn <\/span>  <span><i><\/i> 64<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u672c\u6587\u8f6c\u81ea Unity Connect \u535a\u4e3b \u5927\u667a<\/p>\n<p>\u7528\u8fc7\u4e00\u6bb5\u65f6\u95f4 Timeline \u540e\uff0c\u6211\u95ee\u5927\u667a\uff1a\u201cTimeline \u4e2d\u53ea\u6709\u8fd9\u4e48\u51e0\u4e2a\u8f68\u9053\u4e48\uff1f\u6211\u53d1\u73b0\u6709\u7684\u9700\u6c42\u8fd9\u4e9b\u8f68\u9053\u6839\u672c\u6ca1\u529e\u6cd5\u6ee1\u8db3\uff0c\u4f7f\u7528\u4e4b\u524d\u5b66\u8fc7\u7684 Playable Track \u4e5f\u5f88\u9ebb\u70e6\uff0c\u8fd8\u6709\u5176\u4ed6\u529e\u6cd5\u4e48\uff1f\u201d<\/p>\n<p>\u7528\u8fc7\u4e00\u6bb5\u65f6\u95f4 Timeline \u540e\uff0c\u6211\u95ee\u5927\u667a\uff1a\u201cTimeline \u4e2d\u53ea\u6709\u8fd9\u4e48\u51e0\u4e2a\u8f68\u9053\u4e48\uff1f\u6211\u53d1\u73b0\u6709\u7684\u9700\u6c42\u8fd9\u4e9b\u8f68\u9053\u6839\u672c\u6ca1\u529e\u6cd5\u6ee1\u8db3\uff0c\u4f7f\u7528\u4e4b\u524d\u5b66\u8fc7\u7684 Playable Track \u4e5f\u5f88\u9ebb\u70e6\uff0c\u8fd8\u6709\u5176\u4ed6\u529e\u6cd5\u4e48\uff1f\u201d \u5927\u667a\uff1a\u201c\u4f60\u9047\u5230\u4e86\u4ec0\u4e48\u95ee\u9898\u5462\uff1f\u201d \u5c0f\u65b0\uff1a\u201c\u4e4b\u524d\u54b1\u4eec\u5b66\u7684\u90a3\u4e2a Playable \u8f68\u9053\u5176\u4e2d\u4e00\u4e2a\u95ee\u9898\u662f\uff1a\u6bcf\u6b21\u6dfb\u52a0\u81ea\u5b9a\u4e49 clip \u65f6\uff0c\u90fd\u9700\u8981\u7ed9\u5b83\u6307\u5b9a Light \u7ec4\u4ef6\uff0c\u5982\u679c Clip \u5f88\u591a\uff0c\u4f1a\u975e\u5e38\u9ebb\u70e6\u3002\u201d \u5927\u667a\uff1a\u201c\u8fd9\u4e2a\u8fd8\u597d\uff0c\u4e0d\u7b97\u4e2a\u5927\u95ee\u9898\uff0c\u591a\u9009\u5c31\u80fd\u4e00\u6b21\u641e\u5b9a\u3002\u4e0d\u8fc7\u4f60\u53ef\u80fd\u66f4\u9700\u8981\u7684\u662f\u81ea\u5b9a\u4e49\u8f68\u9053\u3002\u4f7f\u7528\u81ea\u5b9a\u4e49\u8f68\u9053\u6709\u51e0\u4e2a\u597d\u5904\uff1a<\/p>\n<p>\u53ef\u4ee5\u53d1\u6325\u4f60\u7684\u8111\u6d1e\uff0c\u7528\u4ee3\u7801\u5b9e\u73b0\u51fa\u65e0\u9650\u7684\u53ef\u80fd \u53ef\u4ee5\u89e3\u51b3\u8f68\u9053\u7684\u7ed1\u5b9a\uff08\u5982\u4e0b\u56fe\u4e2d\u7684 Bound object \uff09\u95ee\u9898\uff0c\u53ea\u9700\u8981\u7ed1\u5b9a\u4e00\u6b21\uff0c\u8f68\u9053\u4e0a\u7684\u6240\u6709 Clip \u90fd\u53ef\u4ee5\u8bbf\u95ee\u3002\u6bd4\u5982 Animation Track\u3001Activation Track \u90fd\u662f\u8fd9\u6837\u7684\u3002 Playable Track \u4e0a\u5982\u679c\u6df7\u7528\u5f88\u591a\u7c7b\u578b\u7684 Clip \u65f6\uff0c\u6700\u540e\u4f1a\u5f88\u6df7\u4e71\uff0c\u4e5f\u4e0d\u76f4\u89c2\u3002\u81ea\u5b9a\u4e49\u8f68\u9053\u53ef\u4ee5\u76f4\u89c2\u5730\u5c06\u4e0d\u540c\u7528\u9014\u7684\u8f68\u9053\u533a\u5206\u5f00\u3002<\/p>\n<p>\u8f68\u9053\u7684\u7ed3\u6784\u56fe \u90a3\u6211\u4eec\u6765\u770b\u770b\u5982\u4f55\u628a\u4e4b\u524d\u5b66\u4e60 Playable \u8f68\u9053\u65f6\u7684\u81ea\u5b9a\u4e49 Light Clip \u6539\u6210\u81ea\u5b9a\u4e49\u8f68\u9053\uff0c\u7136\u540e\u7ed1\u5b9a Light \u7ec4\u4ef6\u3002 \u6ce8\u610f\u4e0b\u9762\u662f\u57fa\u4e8e\u4e4b\u524d\u7684 Playable \u8f68\u9053\u8fd9\u4e00\u8282\u5b66\u4e60\u7684\uff0c\u5982\u679c\u8fd8\u6ca1\u5b66\u4e60\uff0c\u5efa\u8bae\u5148\u53bb\u5b66\u4e60 Playable \u8f68\u9053\u3002<\/p>\n<p>\u81ea\u5b9a\u4e49\u8f68\u9053<\/p>\n<p>\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u8f68\u9053\u7684\u811a\u672c\uff0c\u7ee7\u627f TrackAsset\uff1a using UnityEngine; using UnityEngine.Timeline;<\/p>\n<p>[TrackClipType(typeof(LightControlAsset))] [TrackBindingType(typeof(Light))] public class LightControlTrack : TrackAsset {} \u8fd9\u6bb5\u4ee3\u7801\u7528\u4e86\u4e24\u4e2a Attribute\uff1a TrackClipType \u6307\u5b9a\u4e86\u8f68\u9053\u63a5\u6536\u7684 PlayableAsset \u7c7b\u578b\uff1b TrackBindingType \u6307\u5b9a\u4e86\u8f68\u9053\u8981\u6c42\u7ed1\u5b9a\u7684\u5bf9\u8c61\u7c7b\u578b\u3002 \u73b0\u5728\u8fd8\u9700\u8981\u4fee\u6539 PlayableAsset \u548c PlayableBehaviour\uff0c\u4e5f\u5c31\u662f\u4e4b\u524d\u7684 LightControlAsset \u548c LightControlBehaviour\u3002 LightControlBehaviour \u7684\u4ee3\u7801\u5982\u4e0b\uff1a using UnityEngine; using UnityEngine.Playables;<\/p>\n<p>public class LightControlBehaviour : PlayableBehaviour { \/\/public Light light = null; \u4e0d\u518d\u9700\u8981\u5b83\u4e86 public Color color = Color.white; public float intensity = 1f;<\/p>\n<p>public override void ProcessFrame(Playable playable, FrameData info, object playerData) { Light light = playerData as Light; \/\/ \u8fd9\u4e2a\u5730\u65b9\u6709\u53d8\u5316<\/p>\n<pre><code>   if (light != null)    {        light.color = color;        light.intensity = intensity;    } <\/code><\/pre>\n<p>} } PlayableBehaviour \u4e2d\u5c31\u4e0d\u518d\u9700\u8981 Light \u6210\u5458\u53d8\u91cf\u4e86\uff0c\u56e0\u4e3a\u53ef\u4ee5\u4ece\u65b9\u6cd5\u7684 playerData \u4e2d\u83b7\u53d6\u5230\uff0c\u8f6c\u6362\u6210\u5bf9\u5e94\u7684\u7c7b\u578b\u5373\u53ef\u3002 using UnityEngine; using UnityEngine.Playables;<\/p>\n<p>public class LightControlAsset : PlayableAsset { \/\/public ExposedReference&lt;light&gt; light; \u4e0d\u9700\u8981\u5b83\u4e86 public Color color = Color.white; public float intensity = 1f;&lt;\/light&gt;<\/p>\n<p>public override Playable CreatePlayable (PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable&lt;lightcontrolbehaviour&gt;.Create(graph);&lt;\/lightcontrolbehaviour&gt;<\/p>\n<pre><code>   var lightControlBehaviour = playable.GetBehaviour();    \/\/lightControlBehaviour.light = light.Resolve(graph.GetResolver());    lightControlBehaviour.color = color;    lightControlBehaviour.intensity = intensity;     return playable;    <\/code><\/pre>\n<p>} } PlayableAsset \u4e2d\u4e5f\u4e0d\u9700\u8981\u518d\u4fdd\u7559 ExposedReference&lt;light&gt;\u4e86\uff0c\u8f68\u9053\u4f1a\u76f4\u63a5\u63d0\u4f9b\u8fd9\u4e2a Light \u5bf9\u8c61\u3002 \u5728 Timeline \u4e2d\u6dfb\u52a0 \u73b0\u5728\u5c31\u53ef\u4ee5\u5728 Timeline \u4e2d\u76f4\u63a5\u6dfb\u52a0 Light Control Track \u4e86\u3002&lt;\/light&gt;<\/p>\n<p>\u6dfb\u52a0 Track \u540e\uff0c\u9700\u8981\u8bbe\u7f6e\u7ed1\u5b9a\u7684\u5bf9\u8c61\u3002\u8fd9\u6837\u6bcf\u4e2a Clip \u90fd\u53ef\u4ee5\u83b7\u53d6\u5230\u8fd9\u4e2a\u7ed1\u5b9a\u7684\u5bf9\u8c61\u3002 \u5c31\u53ef\u4ee5\u50cf\u5185\u7f6e\u7684 Track \u4e00\u6837\u4f7f\u7528\u5566\uff01 \u603b\u7ed3 \u81ea\u5b9a\u4e49\u8f68\u9053\u53ef\u4ee5\u652f\u6301\u4f60\u4efb\u610f\u53d1\u6325\uff0c\u751a\u81f3\u53ef\u4ee5\u8ba9 Timeline \u53d8\u6210\u4e00\u4e2a\u975e\u7ebf\u6027\u8fd0\u884c\uff0c\u53ef\u4ea4\u4e92\u7684\u5e8f\u5217\u52a8\u753b\uff0c\u662f\u4e0d\u662f\u53c8\u52fe\u8d77\u4e86\u4f60\u7684\u5174\u8da3\uff1f\u90a3\u5c31\u5feb\u6765\u8ddf\u6211\u5c0f\u65b0\u4e00\u8d77\u6765\u5427\u3002 [\u6269\u5c55\u5b66\u4e60] \u5bf9 Timeline&amp;Cinemachine \u611f\u5174\u8da3\u7684\u7ae5\u978b\uff1a\u66f4\u591a\u6559\u7a0b\u5728\u6d2a\u6d41\u5b66\u5802\u516c\u4f17\u53f7\u56de\u590d timeline \u83b7\u53d6\uff0c\u514d\u8d39\u83b7\u53d6\u56fe\u6587\u624b\u518c\uff0c\u66f4\u6709\u89c6\u9891\u6559\u7a0b\u3002<\/p>\n<p>\u539f\u6587\u94fe\u63a5\uff1a https:\/\/connect.unity.com\/p\/ru-he-zai-timelinezhong-chuang-jian-zi-ding-yi-gui-dao?app=true \u66f4\u591a Unity \u7cbe\u5f69\u5185\u5bb9\uff0c\u8bf7\u6233\u4e0a\u65b9\u94fe\u63a5\uff0c\u4e0b\u8f7d Unity \u5b98\u65b9 app\uff0c\u5728\u7ebf\u8ba8\u8bba\uff0c\u6280\u672f\u7b54\u7591\uff0c\u5e72\u8d27\u6ee1\u6ee1\uff01<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728 Timeline \u4e2d\u521b\u5efa\u81ea&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/96293"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96293"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/96293\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96293"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}