PlayableTrack.cs 659 B

1234567891011121314151617181920212223
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.Playables;
  4. namespace UnityEngine.Timeline
  5. {
  6. /// <summary>
  7. /// A PlayableTrack is a track whose clips are custom playables.
  8. /// </summary>
  9. /// <remarks>
  10. /// This is a track that can contain PlayableAssets that are found in the project and do not have their own specified track type.
  11. /// </remarks>
  12. [Serializable]
  13. public class PlayableTrack : TrackAsset
  14. {
  15. /// <inheritdoc />
  16. protected override void OnCreateClip(TimelineClip clip)
  17. {
  18. if (clip.asset != null)
  19. clip.displayName = clip.asset.GetType().Name;
  20. }
  21. }
  22. }