Guest User

Untitled

a guest
May 19th, 2020
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.Playables;
  3. using UnityEngine.Timeline;
  4. using Skatebirb.Gameplay;
  5.  
  6. namespace Skatebirb.Timeline
  7. {
  8. [TrackBindingType(typeof(MissionGiver))]
  9. [TrackClipType(typeof(DialogAsset))]
  10. [TrackColor(0.85f, 0f, 1.0f)]
  11. public class DialogTrack : TrackAsset
  12. {
  13. public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
  14. {
  15. foreach (TimelineClip clip in m_Clips)
  16. {
  17. DialogAsset dialog = clip.asset as DialogAsset;
  18. if (dialog != null && !string.IsNullOrEmpty(dialog.dialogName))
  19. {
  20. clip.displayName = dialog.dialogName;
  21. }
  22. else
  23. {
  24. clip.displayName = "(undefined)";
  25. }
  26. }
  27.  
  28. return ScriptPlayable<DialogMixerBehaviour>.Create(graph, inputCount);
  29. }
  30. }
  31. }
Add Comment
Please, Sign In to add comment