public virtual void UpdateTrackContents(DirectorControlState state, Rect position, Rect headerBackground) { this.state = state; trackArea = position; List <KeyValuePair <int, TimelineItemWrapper> > list = new List <KeyValuePair <int, TimelineItemWrapper> >(); foreach (TimelineItemWrapper current in itemMap.Keys) { TrackItemControl trackItemControl = itemMap[current]; trackItemControl.Wrapper = current; trackItemControl.Track = TargetTrack; trackItemControl.PreUpdate(state, position); KeyValuePair <int, TimelineItemWrapper> item = new KeyValuePair <int, TimelineItemWrapper>(trackItemControl.DrawPriority, current); list.Add(item); } list.Sort(Comparison); foreach (KeyValuePair <int, TimelineItemWrapper> current2 in list) { itemMap[current2.Value].HandleInput(state, position); } list.Reverse(); Rect rect = new Rect(0f, 0f, position.width, position.height); int controlID = GUIUtility.GetControlID(TargetTrack.Behaviour.GetInstanceID(), FocusType.Passive, rect); EventType typeForControl = Event.current.GetTypeForControl(controlID); headerBackground.height += 100; bool mark = headerBackground.Contains(Event.current.mousePosition); foreach (KeyValuePair <int, TimelineItemWrapper> current3 in list) { TrackItemControl expr_111 = itemMap[current3.Value]; expr_111.Draw(state); expr_111.PostUpdate(state, mark, typeForControl); } if (typeForControl == EventType.MouseDown && rect.Contains(Event.current.mousePosition) && Event.current.button == 1 && !Event.current.alt && !Event.current.shift && !Event.current.control) { showBodyContextMenu(Event.current); Event.current.Use(); } }
public virtual void UpdateTrackContents(DirectorControlState state, UnityEngine.Rect position) { this.state = state; this.trackArea = position; List <KeyValuePair <int, TimelineItemWrapper> > list = new List <KeyValuePair <int, TimelineItemWrapper> >(); foreach (TimelineItemWrapper wrapper in this.itemMap.Keys) { TrackItemControl control = this.itemMap[wrapper]; control.Wrapper = wrapper; control.Track = this.TargetTrack; control.PreUpdate(state, position); KeyValuePair <int, TimelineItemWrapper> item = new KeyValuePair <int, TimelineItemWrapper>(control.DrawPriority, wrapper); list.Add(item); } list.Sort(new Comparison <KeyValuePair <int, TimelineItemWrapper> >(TimelineTrackControl.Comparison)); foreach (KeyValuePair <int, TimelineItemWrapper> pair2 in list) { this.itemMap[pair2.Value].HandleInput(state, position); } list.Reverse(); foreach (KeyValuePair <int, TimelineItemWrapper> pair3 in list) { TrackItemControl local1 = this.itemMap[pair3.Value]; local1.Draw(state); local1.PostUpdate(state); } UnityEngine.Rect rect = new UnityEngine.Rect(0f, 0f, position.width, position.height); int num = GUIUtility.GetControlID(this.TargetTrack.Behaviour.GetInstanceID(), (FocusType)2, rect); if ((((Event.current.GetTypeForControl(num) == EventType.MouseUp) && rect.Contains(Event.current.mousePosition)) && ((Event.current.button == 1) && !Event.current.alt)) && (!Event.current.shift && !Event.current.control)) { this.showBodyContextMenu(Event.current); Event.current.Use(); } }