ItemsPerTrack.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UnityEngine.Timeline;
  5. namespace UnityEditor.Timeline
  6. {
  7. class ItemsPerTrack
  8. {
  9. public virtual TrackAsset targetTrack { get; }
  10. public IEnumerable<ITimelineItem> items
  11. {
  12. get { return m_ItemsGroup.items; }
  13. }
  14. public IEnumerable<TimelineClip> clips
  15. {
  16. get { return m_ItemsGroup.items.OfType<ClipItem>().Select(i => i.clip); }
  17. }
  18. public IEnumerable<IMarker> markers
  19. {
  20. get { return m_ItemsGroup.items.OfType<MarkerItem>().Select(i => i.marker); }
  21. }
  22. public ITimelineItem leftMostItem
  23. {
  24. get { return m_ItemsGroup.leftMostItem; }
  25. }
  26. public ITimelineItem rightMostItem
  27. {
  28. get { return m_ItemsGroup.rightMostItem; }
  29. }
  30. protected readonly ItemsGroup m_ItemsGroup;
  31. public ItemsPerTrack(TrackAsset targetTrack, IEnumerable<ITimelineItem> items)
  32. {
  33. this.targetTrack = targetTrack;
  34. m_ItemsGroup = new ItemsGroup(items);
  35. }
  36. }
  37. }