public override bool DrawTrack(Rect trackRect, TrackAsset trackAsset, Vector2 visibleTime, ITimelineState state)
        {
            this.m_TrackRect = trackRect;
            TimelineWindow.TimelineState timelineState = (TimelineWindow.TimelineState)state;
            bool result;

            if (!this.CanDraw(trackAsset, timelineState))
            {
                result = true;
            }
            else
            {
                if (timelineState.recording && timelineState.IsArmedForRecord(trackAsset))
                {
                    InfiniteTrackDrawer.DrawRecordBackground(trackRect);
                }
                GUI.Box(trackRect, GUIContent.none, DirectorStyles.Instance.infiniteTrack);
                Rect rect = trackRect;
                rect.set_yMin(rect.get_yMax());
                rect.set_height(15f);
                GUI.DrawTexture(rect, DirectorStyles.Instance.bottomShadow.get_normal().get_background(), 0);
                float[] keys = this.m_DataSource.GetKeys();
                if (keys != null && keys.Length > 0)
                {
                    float[] array = keys;
                    for (int i = 0; i < array.Length; i++)
                    {
                        float key = array[i];
                        this.DrawKeyFrame(key, timelineState);
                    }
                }
                result = true;
            }
            return(result);
        }
        public bool CanDraw(TrackAsset track, TimelineWindow.TimelineState state)
        {
            float[] keys = this.m_DataSource.GetKeys();
            bool    flag = track.clips.Length == 0;

            return(keys != null || (state.IsArmedForRecord(track) && flag));
        }
Пример #3
0
 private bool IsRecording(TimelineWindow.TimelineState state)
 {
     return(state.recording && state.IsArmedForRecord(base.track));
 }