Ejemplo n.º 1
0
 protected override void prepareTrackItemControlForRemoval(TrackItemControl control)
 {
     base.prepareTrackItemControlForRemoval(control);
     if (control is CinemaCurveClipItemControl)
     {
         (control as CinemaCurveClipItemControl).RequestEdit -= new CurveClipWrapperEventHandler(this.curveClipControl_RequestEdit);
     }
 }
Ejemplo n.º 2
0
 protected override void initializeTrackItemControl(TrackItemControl control)
 {
     base.initializeTrackItemControl(control);
     if (control is CinemaCurveClipItemControl)
     {
         (control as CinemaCurveClipItemControl).RequestEdit += new CurveClipWrapperEventHandler(this.curveClipControl_RequestEdit);
     }
 }
Ejemplo n.º 3
0
 internal void DeleteSelectedChildren()
 {
     foreach (TimelineItemWrapper current in this.itemMap.Keys)
     {
         TrackItemControl trackItemControl = this.itemMap[current];
         if (trackItemControl.IsSelected)
         {
             trackItemControl.Delete();
         }
     }
 }
Ejemplo n.º 4
0
 internal void DeleteSelectedChildren()
 {
     foreach (TimelineItemWrapper wrapper in this.itemMap.Keys)
     {
         TrackItemControl control = this.itemMap[wrapper];
         if (control.IsSelected)
         {
             control.Delete();
         }
     }
 }
Ejemplo n.º 5
0
    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();
        }
    }
Ejemplo n.º 6
0
    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();
        }
    }
Ejemplo n.º 7
0
 protected virtual void prepareTrackItemControlForRemoval(TrackItemControl control)
 {
 }
Ejemplo n.º 8
0
 protected virtual void initializeTrackItemControl(TrackItemControl control)
 {
 }
Ejemplo n.º 9
0
 internal void BindTimelineItemControls(TimelineTrackWrapper track, List <TrackItemControl> newTimelineControls, List <TrackItemControl> removedTimelineControls)
 {
     if (this.TargetTrack.HasChanged)
     {
         foreach (TimelineItemWrapper current in track.Items)
         {
             TrackItemControl trackItemControl = null;
             if (!this.itemMap.TryGetValue(current, out trackItemControl))
             {
                 Type[] arg_62_0     = DirectorControlHelper.GetAllSubTypes(typeof(TrackItemControl));
                 Type   type         = typeof(TrackItemControl);
                 int    num          = 2147483647;
                 int    drawPriority = 0;
                 Type[] array        = arg_62_0;
                 for (int i = 0; i < array.Length; i++)
                 {
                     Type     type2            = array[i];
                     object[] customAttributes = type2.GetCustomAttributes(typeof(CutsceneItemControlAttribute), true);
                     for (int j = 0; j < customAttributes.Length; j++)
                     {
                         CutsceneItemControlAttribute cutsceneItemControlAttribute = (CutsceneItemControlAttribute)customAttributes[j];
                         if (cutsceneItemControlAttribute != null)
                         {
                             int subTypeDepth = DirectorControlHelper.GetSubTypeDepth(current.Behaviour.GetType(), cutsceneItemControlAttribute.ItemType);
                             if (subTypeDepth < num)
                             {
                                 type         = type2;
                                 num          = subTypeDepth;
                                 drawPriority = cutsceneItemControlAttribute.DrawPriority;
                             }
                         }
                     }
                 }
                 trackItemControl = (TrackItemControl)Activator.CreateInstance(type);
                 trackItemControl.DrawPriority = drawPriority;
                 trackItemControl.Initialize(current, this.TargetTrack);
                 trackItemControl.TrackControl = this;
                 this.initializeTrackItemControl(trackItemControl);
                 newTimelineControls.Add(trackItemControl);
                 this.itemMap.Add(current, trackItemControl);
             }
         }
         List <TimelineItemWrapper> list = new List <TimelineItemWrapper>();
         foreach (TimelineItemWrapper current2 in this.itemMap.Keys)
         {
             bool flag = false;
             foreach (TimelineItemWrapper current3 in track.Items)
             {
                 if (current2.Equals(current3))
                 {
                     flag = true;
                     break;
                 }
             }
             if (!flag)
             {
                 this.prepareTrackItemControlForRemoval(this.itemMap[current2]);
                 removedTimelineControls.Add(this.itemMap[current2]);
                 list.Add(current2);
             }
         }
         foreach (TimelineItemWrapper current4 in list)
         {
             this.itemMap.Remove(current4);
         }
     }
     track.HasChanged = false;
 }
Ejemplo n.º 10
0
 internal void BindTimelineItemControls(TimelineTrackWrapper track, List <TrackItemControl> newTimelineControls, List <TrackItemControl> removedTimelineControls)
 {
     if (this.TargetTrack.HasChanged)
     {
         foreach (TimelineItemWrapper wrapper in track.Items)
         {
             TrackItemControl control = null;
             if (!this.itemMap.TryGetValue(wrapper, out control))
             {
                 Type type         = typeof(TrackItemControl);
                 int  num          = 0x7fffffff;
                 int  drawPriority = 0;
                 foreach (Type type2 in DirectorControlHelper.GetAllSubTypes(typeof(TrackItemControl)))
                 {
                     foreach (CutsceneItemControlAttribute attribute in type2.GetCustomAttributes(typeof(CutsceneItemControlAttribute), true))
                     {
                         if (attribute != null)
                         {
                             int subTypeDepth = DirectorControlHelper.GetSubTypeDepth(wrapper.Behaviour.GetType(), attribute.ItemType);
                             if (subTypeDepth < num)
                             {
                                 type         = type2;
                                 num          = subTypeDepth;
                                 drawPriority = attribute.DrawPriority;
                             }
                         }
                     }
                 }
                 control = (TrackItemControl)Activator.CreateInstance(type);
                 control.DrawPriority = drawPriority;
                 control.Initialize(wrapper, this.TargetTrack);
                 control.TrackControl = this;
                 this.initializeTrackItemControl(control);
                 newTimelineControls.Add(control);
                 this.itemMap.Add(wrapper, control);
             }
         }
         List <TimelineItemWrapper> list = new List <TimelineItemWrapper>();
         foreach (TimelineItemWrapper wrapper2 in this.itemMap.Keys)
         {
             bool flag = false;
             foreach (TimelineItemWrapper wrapper3 in track.Items)
             {
                 if (wrapper2.Equals(wrapper3))
                 {
                     flag = true;
                     break;
                 }
             }
             if (!flag)
             {
                 this.prepareTrackItemControlForRemoval(this.itemMap[wrapper2]);
                 removedTimelineControls.Add(this.itemMap[wrapper2]);
                 list.Add(wrapper2);
             }
         }
         foreach (TimelineItemWrapper wrapper4 in list)
         {
             this.itemMap.Remove(wrapper4);
         }
     }
     track.HasChanged = false;
 }