/// <summary> /// Called by the Timeline Editor to gather properties requiring preview. /// </summary> /// <param name="director">The PlayableDirector invoking the preview</param> /// <param name="driver">PropertyCollector used to gather previewable properties</param> public virtual void GatherProperties(PlayableDirector director, IPropertyCollector driver) { // only push on game objects if there is a binding. Subtracks // will use objects on the stack var gameObject = GetGameObjectBinding(director); if (gameObject != null) driver.PushActiveGameObject(gameObject); if (hasCurves) driver.AddObjectProperties(this, m_Curves); foreach (var clip in clips) { if (clip.curves != null && clip.asset != null) driver.AddObjectProperties(clip.asset, clip.curves); IPropertyPreview modifier = clip.asset as IPropertyPreview; if (modifier != null) modifier.GatherProperties(director, driver); } foreach (var subtrack in GetChildTracks()) { if (subtrack != null) subtrack.GatherProperties(director, driver); } if (gameObject != null) driver.PopActiveGameObject(); }
public virtual void GatherProperties(PlayableDirector director, IPropertyCollector driver) { GameObject gameObjectBinding = this.GetGameObjectBinding(director); if (gameObjectBinding != null) { driver.PushActiveGameObject(gameObjectBinding); } if (this.animClip != null) { driver.AddFromClip(this.animClip); } foreach (TimelineClip timelineClip in this.clips) { if (timelineClip.curves != null && timelineClip.asset != null) { driver.AddObjectProperties(timelineClip.asset, timelineClip.curves); } IPropertyPreview propertyPreview = timelineClip.asset as IPropertyPreview; if (propertyPreview != null) { propertyPreview.GatherProperties(director, driver); } } foreach (TrackAsset trackAsset in this.GetChildTracks()) { if (trackAsset != null) { trackAsset.GatherProperties(director, driver); } } if (gameObjectBinding != null) { driver.PopActiveGameObject(); } }