Search Unity

Handling Seeking/Skipping for Custom Playables in 2018.4.x

Discussion in 'Timeline' started by myopia, Jun 6, 2019.

  1. myopia

    myopia

    Joined:
    Sep 25, 2013
    Posts:
    1
    Is there a way to detect completely skipping over (either via a rewind or fast forward) a PlayableAsset? This seems to work for keyframe data in an AnimationTrack. For example, if the playhead is before the start of a keyframe tweened animation clip and you seek/skip over it by moving (not dragging, but rather a discrete click) the playhead after the clip, the associated GameObject will snap to its last keyframe. The same works in the case of rewinding.

    If at least one frame of the PlayableAsset was played I'm pretty sure you could detect this with OnBehaviorPause and the FrameData parameter. However, if the PlayableAsset is completely rewinded/skipped OnBehaviorPause never gets called.

    How does AnimationTrack handle this? Or rather, how can I get functionality like AnimationTrack for my custom Playable?

    Thanks!