Search Unity

Getting Signals / Markers on a track

Discussion in 'Timeline' started by hoperin, Jun 5, 2019.

  1. hoperin

    hoperin

    Joined:
    Feb 9, 2014
    Posts:
    52
    So I'm dipping my feet into using signals and markers and am thinking that my artist and creative director will definitely be happy to use them rather than my janky workaround of making short duration clips that execute one shot code. However, that means I need to integrate signals into my extensive timeline extension scripts.

    In particular, I have a system that rebuilds & reshuffles all the clips and tracks on a timeline, based on external factors that don't matter here. But I need to be able to get all the signals on a track, and move them around on the timeline.

    For example, I do a lot of stuff like this:


    void MoveAllFXClipsOver(TrackAsset track){
    foreach (TimelineClip clip in track.GetClips()){
    clip.start = clip.start + wholeTLOffset;
    }
    }


    I'm particularly looking for a parallel to track.GetClips() for signals and markers. AFAIK there's no documentation in the APIs for Signals yet so I'm just stumbling around guessing at what the right code could be...
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    TrackAsset.GetMarkers(). It returns a list of IMarker which can be signals, or other types of markers