MatControlTrack.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using UnityEngine;
  2. using UnityEngine.Playables;
  3. using UnityEngine.Timeline;
  4. using System.Collections.Generic;
  5. [TrackColor(0.9454092f, 0.9779412f, 0.3883002f)]
  6. [TrackClipType(typeof(MatControlClip))]
  7. [TrackBindingType(typeof(Renderer))]
  8. public class MatControlTrack : TrackAsset
  9. {
  10. public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
  11. {
  12. foreach (var clip in GetClips())
  13. {
  14. var mcb = clip.asset as MatControlClip;
  15. mcb.clipPassthrough = clip;
  16. }
  17. return ScriptPlayable<MatControlMixerBehaviour>.Create(graph, inputCount);
  18. }
  19. public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
  20. {
  21. /*
  22. #if UNITY_EDITOR
  23. Material trackBinding = director.GetGenericBinding(this) as Material;
  24. if (trackBinding == null)
  25. return;
  26. driver.AddFromName<Light>(trackBinding, "m_Color");
  27. driver.AddFromName<Light>(trackBinding.gameObject, "m_Intensity");
  28. driver.AddFromName<Light>(trackBinding.gameObject, "m_Range");
  29. driver.AddFromName<Light>(trackBinding.gameObject, "m_BounceIntensity");
  30. #endif
  31. base.GatherProperties(director, driver);
  32. */
  33. }
  34. }