Search Unity

PlayableDirector.time not working in Editor Mode...

Discussion in 'Timeline' started by hoperin, Apr 27, 2018.

  1. hoperin

    hoperin

    Joined:
    Feb 9, 2014
    Posts:
    52
    **EDIT -- As soon as I posted this I realized my mistake, it is working just fine, it just isn't updating until I click back into the timeline window. I just have to see if there's a way to update the timeline window right after calling. Please disregard!

    I'm making a custom inspector tool that acts as a navigation pane for long timelines, which has a list of key points(identified by the start time of a clip), where you can bring the playhead to the start of that point. It's really basic code that I've used elsewhere to bounce around the Playhead, but I just realised it doesn't seem to work in Editor mode, only in Play....

    Any idea why this might be / if this is expected behaviour / how to get around this?

    Code (CSharp):
    1.     public void JumpTo(double seconds){
    2.  
    3.         if (dir == null) {
    4.             dir = GameObject.Find ("TIMELINE_MASTER").GetComponentInChildren<PlayableDirector>();
    5.         }
    6.  
    7.         dir.time = seconds;
    8.         //dir.Play();
    9.         Debug.Log ("head should have jumped to " + seconds);
    10.     }
    Thanks in advance!
     
    Last edited: Apr 27, 2018
    TomasL_Thunderful likes this.
  2. DELHOMMEAU_Antoine

    DELHOMMEAU_Antoine

    Joined:
    Nov 25, 2019
    Posts:
    4
    TomasL_Thunderful likes this.