TrackModifier.cs 576 B

123456789101112131415161718192021
  1. using UnityEngine;
  2. using UnityEditor;
  3. using UnityEngine.Timeline;
  4. using UnityEngine.Playables;
  5. namespace UnityEditor.Timeline
  6. {
  7. static class TrackModifier
  8. {
  9. public static bool DeleteTrack(TimelineAsset timeline, TrackAsset track)
  10. {
  11. if (TimelineEditor.inspectedDirector != null)
  12. {
  13. TimelineUndo.PushUndo(TimelineEditor.inspectedDirector, "Delete Track");
  14. TimelineEditor.inspectedDirector.ClearGenericBinding(track);
  15. }
  16. return timeline.DeleteTrack(track);
  17. }
  18. }
  19. }