Unity Timeline 手动更新

this.director.timeUpdateMode = UnityEngine.Playables.DirectorUpdateMode.Manual

PlayeBetween(start:number, seconds: number){
    this.isPaused = false
    this.director.time = start
    this.targetTime = seconds
    this.director.Resume()
}
private UpdateTime(t:number){
    if(this.isPaused)return
    let director = this.director
    let targetTime = this.targetTime
    let deviation = this.devation
    if (director.time > targetTime + deviation)
    {
        director.time -= t;
        director.Evaluate();
    }
    else if (director.time < targetTime - deviation)
    {
        director.time += t;
        director.Evaluate();
    }
    else if (director.time != targetTime)
    {
        director.time = targetTime;
        director.Evaluate();
    }
}