Timeline_を使って演出の幅を広げよう.pdf

 Timeline_を使って演出の幅を広げよう.pdf

Unity Timeline の紹介と,使ってみてハマったところ,解決方法の紹介

Aiming × KLab コラボMeetup!
https://aiming.connpass.com/event/85240/
LT 発表で使った資料となります。

Transcript

  1. Unity Timeline Λ࢖ͬͯ
 ԋग़ͷ෯Λ޿͛Α͏ גࣜձࣾAiming Ϧʔυιϑτ΢ΣΞΤϯδχΞ ౔Ҫ ӳൣ

  2. ԋग़ͱ͍͑͹Χοτγʔϯ • ཁ݅ • Χοτγʔϯͷ࠶ੜΛ͍ͨ͠ • ಉ͡ΧοτγʔϯͰ΋ɼήʔϜͷਐߦঢ় گʹ߹ΘͤͯΩϟϥΫλʔͳͲΛಈతʹ ೖΕସ͍͑ͨ

  3. Timeline ػೳ
 (Unity2017.1 ͔Β)

  4. Ұൠతͳ? ΧοτγʔϯϫʔΫϑϩʔ • ϞσϧσʔλͱɼΧοτγʔϯͷईʹ߹Θ ͤͨΞχϝʔγϣϯσʔλΛ࡞Δ • ࢦఆͨ͠λΠϛϯάͰΞχϝʔγϣϯ΍ɼ ԻΛྲྀ͠ࠐΉػೳΛΤϯδχΞ͕։ൃ • ௐ੔͢Δ৔߹͸

    DCC πʔϧʹ໭ͬͯௐ੔ ͢Δ͜ͱ΋ଟ͍ (͙֬͢ೝͮ͠Β͍)
  5. UNITY TIMELINE Λ࢖ͬͨ
 Χοτγʔϯԋग़ͷσϞ

  6. Timeline Λ͔ͭ͏ͱ • ࣮ߦ࣌ʹϦΞϧλΠϜʹ࠶ੜ͞ΕΔ • ΩϟϥΫλʔͷಈ͖Λݸผʹ੍ޚͰ͖Δ • UnityEditor ࠶ੜఀࢭঢ়ଶ͡Όͳͯ͘΋ɼΞχϝʔ γϣϯ݁Ռ͕֬ೝͰ͖Δ

    • ΞχϝʔγϣϯΛ࢖͍ճͤΔ • DCC πʔϧ্Ͱईʹ߹Θͤͯ࡞Βͳͯ͘΋ɼ ݸʑͷಈ͖Λ࡞͓͍ͬͯͯɼUnity ্Ͱ૊Έ߹Θ ͤͯಈ͖Λͭ͘Δ
  7. Timeline ͱ Animator ൺֱ • Animator • ΞχϝʔγϣϯΛঢ়ଶʹԠͯ͡੾Γସ͑ Δ •

    Timeline • ΞχϝʔγϣϯΛ࣌ؒ࣠ʹԠͯ͡੾Γସ ͑Δ
  8. εΫϦϓτͰ֦ுͰ͖Δ • ಈతͳ৘ใܾఆ • ΩϟϥΫλʔͷࠩ͠ସ͑ • Unity্ͷ৘ใΛ࢖ͬͨΞχϝʔγϣϯ੍ޚ • ҉సͷ࣮૷ •

    γʔϯ্ʹ഑ஔͨ͠ύεʹԊͬͨҠಈ • ͳͲͳͲ
  9. Timeline Ͱ੍ޚՄೳͳ΋ͷ • Ξχϝʔγϣϯ(Ϟʔγϣϯ)࠶ੜ • ΦʔσΟΦ࠶ੜ • Χϝϥ (CinemachineΛผ్ೖΕΔ) •

    εΫϦϓτॻ͚͹ԿͰ΋͍͚Δ
  10. ϋϚͬͨͱ͜Ζ঺հ

  11. ޲͍͍ͯͳ͍΋ͷ • ৚݅Ͱ෼ذ͢ΔΑ͏ͳ΋ͷ • Animator Λ࢖͍·͠ΐ͏ • ࠶ੜ͕࣌ؒݻఆͰ͖ͳ͍΋ͷ • ྫ:

    ෆఆͷڑ཭Λࢦఆͨ͠଎౓Ͱಈ͘ • ૉ௚ʹεΫϦϓτ੍ޚ͠·͠ΐ͏
  12. ࣮ߦ࣌ґଘղܾ • Timeline ͷσʔλ͸ AssetBase ͳͷͰɼ γʔϯʹ഑ஔ͞ΕͨσʔλΛ࢖͏ͷ͕ۤख

  13. ࣮ߦ࣌ґଘղܾ • PlayableDirector ͕γʔϯʹ༧Ί഑ஔ͞Ε ͍ͯΔͳΒ Playable ͔Β͸ࢀরՄೳ

  14. • PlayableAsset ͔Β͸ ExposedReference<T>() Λ࢖͏ ࣮ߦ࣌ґଘղܾ PlayableAsset ͔ΒγʔϯΦϒ δΣΫτΛࢀর͢Δ SerializeField

    ͷΑ͏ͳ΋ͷ
  15. ϓϨϋϒʹΧοτγʔϯΛอଘ͍ͨ͠ • Prefab Խ͢ΔͱγʔϯͷΦϒδΣΫτ͸ࢀরͰ͖ͳ͍ • Prefab ಺ͷΦϒδΣΫτ͸ࢀরՄೳ • Instantiate ޙʹγʔϯ্ͷΦϒδΣΫτΛඥ෇͚Δඞཁ͕͋Δ

    ϦϯΫ੾Εʂʂ
  16. ղܾํ๏ • Bindings ʹγʔϯΦϒδΣΫτΛόΠϯυ ͢ΔεΫϦϓτΛ࡞Δ (SetGenericBinding) [ExecuteInEditMode] public class CinemachineBrainBinder

    : MonoBehaviour { [SerializeField] private PlayableDirector director; private void OnValidate() { Bind(); } private void Start() { Bind(); } public void Bind() { var binding = director.playableAsset .outputs.Where(x => x.streamName == "Cinemachine Track") .First(); director.SetGenericBinding( binding.sourceObject, Camera.main.GetComponent<CinemachineBrain>()); } } ໊લ͔ΒόΠϯυΛऔಘ͢Δ
  17. Timeline Ready ͳΞηοτ͕
 ૿͖͑ͯͯ·͢ • એ఻ • Timeline ੍ޚՄೳͳɼύεʹԊͬͯҠಈ ͢ΔΞηοτΛ

    AssetStore Ͱެ։͠· ͨ͠(স) • https://assetstore.unity.com/packages/ tools/animation/b-spline-path-105412
  18. ݱ৔ͷχʔζʹԠͯ͡ ΤϯδχΞͱσβΠφ͕࿈ܞ͠ͳ͕Β
 Timeline ԽΛ͠Α͏ʂ ΧοτΠϯͷϫʔΫϑϩʔ͕վળ͠·͢