Search Unity

Information on integrating with Timeline needed

Discussion in 'Timeline' started by jerotas, Jun 18, 2017.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    4,958
    Timeline - awesome feature. So it can play audio clips. Cool, but not useful to me and other audio middleware users. Because for starters you can't play 1 of 4 variations at random, or with randomized pitch or with custom fading and a lot of other things.

    Anyway what I am wanting to know is how does one write a script that can be used on Timeline? Does any old Monobehavior just work? Or does the script need to be a subclass of a certain class with certain events in it, like the scripts you can write for Mechanim?

    Or can I just call static methods on any script in the Hierarchy?

    If it's fairly simple, I would love to add Timeline support for all our plugins.

    Thank you for any information!
     
    Last edited: Jun 18, 2017
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    883
    Tough question to give a simple answer to!

    Timeline is extendable. You can create your own clips and tracks types using the Playable system. Timeline itself it the first application of Playables beyond Animation.

    The general idea is you write Scriptable Objects that represent the data of your clips and tracks, and write Playables that handle the runtime processing (think of them as instances of your data + processing algorithms). I've attached a sample if you want to have a look.

    We have documentation coming to help with this, but because you want to extend Audio, it's slightly more complicated because the Audio in timeline uses scheduled playback, which means it's handled differently than other clip/playable types.
     

    Attached Files:

  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    4,958
    Thanks for the response. I will try to integrate and see what happens!