首页 > 其他分享 >Timeline - 获取所有轨道,轨道的片段信息

Timeline - 获取所有轨道,轨道的片段信息

时间:2023-01-06 19:56:03浏览次数:42  
标签:片段 Log outputTargetType 轨道 sourceObject pb Timeline Debug

#

var timelineAsset = director.playableAsset as TimelineAsset;
foreach (PlayableBinding pb in timelineAsset.outputs)
{
    //pb.streamName--轨道名称
    //pb.sourceObject--轨道, 获取到轨道就可以获取ClipAsset
    //pb.outputTargetType--轨道绑定的类型, TrackBindingType

    Debug.Log("=====track");
    Debug.Log($"type:{pb.GetType().Name}, trackName:{pb.streamName}");

    if (null != pb.sourceObject)
    {
        TrackAsset trackAsset = pb.sourceObject as TrackAsset;
        foreach (TimelineClip clip in trackAsset.GetClips()) //轨道上的所有片段
        {
            //...
        }
    }
    if (null != pb.outputTargetType)
    {
        Debug.Log($"[TrackBindingType]: {pb.outputTargetType.Name}");
    }
}

 

标签:片段,Log,outputTargetType,轨道,sourceObject,pb,Timeline,Debug
From: https://www.cnblogs.com/sailJs/p/17010031.html

相关文章