12345678910111213141516171819202122232425262728293031323334353637383940 |
- using UnityEngine;
- using UnityEngine.Playables;
- using UnityEngine.Timeline;
- using System.Collections.Generic;
- [TrackColor(0.9454092f, 0.9779412f, 0.3883002f)]
- [TrackClipType(typeof(MatControlClip))]
- [TrackBindingType(typeof(Renderer))]
- public class MatControlTrack : TrackAsset
- {
- public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
- {
- foreach (var clip in GetClips())
- {
- var mcb = clip.asset as MatControlClip;
- mcb.clipPassthrough = clip;
- }
- return ScriptPlayable<MatControlMixerBehaviour>.Create(graph, inputCount);
- }
- public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
- {
- /*
- #if UNITY_EDITOR
- Material trackBinding = director.GetGenericBinding(this) as Material;
- if (trackBinding == null)
- return;
-
- driver.AddFromName<Light>(trackBinding, "m_Color");
- driver.AddFromName<Light>(trackBinding.gameObject, "m_Intensity");
- driver.AddFromName<Light>(trackBinding.gameObject, "m_Range");
- driver.AddFromName<Light>(trackBinding.gameObject, "m_BounceIntensity");
- #endif
- base.GatherProperties(director, driver);
- */
- }
- }
|