LightControlTrack.cs 1.1 KB

1234567891011121314151617181920212223242526272829
  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(LightControlClip))]
  7. [TrackBindingType(typeof(Light))]
  8. public class LightControlTrack : TrackAsset
  9. {
  10. public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
  11. {
  12. return ScriptPlayable<LightControlMixerBehaviour>.Create (graph, inputCount);
  13. }
  14. public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
  15. {
  16. #if UNITY_EDITOR
  17. Light trackBinding = director.GetGenericBinding(this) as Light;
  18. if (trackBinding == null)
  19. return;
  20. driver.AddFromName<Light>(trackBinding.gameObject, "m_Color");
  21. driver.AddFromName<Light>(trackBinding.gameObject, "m_Intensity");
  22. driver.AddFromName<Light>(trackBinding.gameObject, "m_Range");
  23. driver.AddFromName<Light>(trackBinding.gameObject, "m_BounceIntensity");
  24. #endif
  25. base.GatherProperties(director, driver);
  26. }
  27. }