I was digging information all day long about how to create a set of custom track/asset/behaviour that can use another type of custom track/asset/behaviour, as to how we could use Control track to control another timeline.
My main objective is to make some subtitle for our animation, but need to sync audio & text colour rendering word by word. And there will be a lot of sentences as well.
So I was thinking about making a custom track act as the sentence track, where it contains all the words as playable clips under its sub-track so we can do some detail adjustment to each word.
You can - but it requires you to use two different playable directors.
To create your own subtimeline track, your custom track clip can have a ClipEditor that implements GetSubTimelines to return the nested timeline/playableDirector.
For control tracks, it nests by having the user explicitly assign the playable director with the sub timeline, but you could change the workflow and auto-create what you need.
[CustomTimelineEditor(typeof(ControlPlayableAsset))]
class ControlPlayableAssetEditor : ClipEditor
{
public override void GetSubTimelines(TimelineClip clip, PlayableDirector director, List<PlayableDirector> subTimelines)
{
... // add the nested timeline to the subTimelines list
}
}