예제 #1
0
 public override void Initialize(TimeArea timeArea)
 {
     base.Initialize(timeArea);
     this.m_CurveEditor = timeArea as CurveEditor;
     if (this.m_HBarLeft == null)
     {
         this.m_HBarLeft             = new AreaManipulator(base.styles.rectangleToolHBarLeft, MouseCursor.ResizeHorizontal);
         this.m_HBarLeft.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_HBarLeft.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Right, RectangleTool.ToolCoord.Left, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), DragMode.ScaleHorizontal, base.rippleTimeClutch);
                 return(true);
             }
             return(false);
         });
         this.m_HBarLeft.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_HBarLeft.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         });
         this.m_HBarLeft.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_HBarLeft.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
     if (this.m_HBarRight == null)
     {
         this.m_HBarRight             = new AreaManipulator(base.styles.rectangleToolHBarRight, MouseCursor.ResizeHorizontal);
         this.m_HBarRight.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_HBarRight.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Left, RectangleTool.ToolCoord.Right, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), DragMode.ScaleHorizontal, base.rippleTimeClutch);
                 return(true);
             }
             return(false);
         });
         this.m_HBarRight.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_HBarRight.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         });
         this.m_HBarRight.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_HBarRight.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
     if (this.m_HBar == null)
     {
         this.m_HBar             = new AreaManipulator(base.styles.rectangleToolHBar, MouseCursor.MoveArrow);
         this.m_HBar.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_HBar.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), DragMode.MoveHorizontal, base.rippleTimeClutch);
                 return(true);
             }
             return(false);
         });
         this.m_HBar.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_HBar.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f));
             return(true);
         });
         this.m_HBar.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_HBar.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndMove();
             return(true);
         });
     }
     if (this.m_VBarBottom == null)
     {
         this.m_VBarBottom             = new AreaManipulator(base.styles.rectangleToolVBarBottom, MouseCursor.ResizeVertical);
         this.m_VBarBottom.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_VBarBottom.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Top, RectangleTool.ToolCoord.Bottom, new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), DragMode.ScaleVertical, false);
                 return(true);
             }
             return(false);
         });
         this.m_VBarBottom.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_VBarBottom.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleValue(base.PixelToValue(evt.mousePosition.y));
             return(true);
         });
         this.m_VBarBottom.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_VBarBottom.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
     if (this.m_VBarTop == null)
     {
         this.m_VBarTop             = new AreaManipulator(base.styles.rectangleToolVBarTop, MouseCursor.ResizeVertical);
         this.m_VBarTop.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_VBarTop.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Bottom, RectangleTool.ToolCoord.Top, new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), DragMode.ScaleVertical, false);
                 return(true);
             }
             return(false);
         });
         this.m_VBarTop.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_VBarTop.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleValue(base.PixelToValue(evt.mousePosition.y));
             return(true);
         });
         this.m_VBarTop.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_VBarTop.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
     if (this.m_VBar == null)
     {
         this.m_VBar             = new AreaManipulator(base.styles.rectangleToolVBar, MouseCursor.MoveArrow);
         this.m_VBar.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_VBar.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartMove(new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), DragMode.MoveVertical, false);
                 return(true);
             }
             return(false);
         });
         this.m_VBar.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_VBar.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnMove(new Vector2(0f, base.PixelToValue(evt.mousePosition.y)));
             return(true);
         });
         this.m_VBar.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_VBar.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndMove();
             return(true);
         });
     }
     if (this.m_SelectionBox == null)
     {
         this.m_SelectionBox             = new AreaManipulator(base.styles.rectangleToolSelection, MouseCursor.MoveArrow);
         this.m_SelectionBox.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_SelectionBox.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             bool flag = evt.shift || EditorGUI.actionKey;
             if ((!(Mathf.Approximately(this.selectionBounds.size.x, 0f) && Mathf.Approximately(this.selectionBounds.size.y, 0f)) && !flag) && (this.hasSelection && manipulator.rect.Contains(evt.mousePosition)))
             {
                 this.OnStartMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), base.PixelToValue(evt.mousePosition.y)), !base.rippleTimeClutch ? DragMode.MoveBothAxis : DragMode.MoveHorizontal, base.rippleTimeClutch);
                 return(true);
             }
             return(false);
         });
         this.m_SelectionBox.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_SelectionBox.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), base.PixelToValue(evt.mousePosition.y)));
             return(true);
         });
         this.m_SelectionBox.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_SelectionBox.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndMove();
             return(true);
         });
     }
     if (this.m_SelectionScaleLeft == null)
     {
         this.m_SelectionScaleLeft             = new AreaManipulator(base.styles.rectangleToolScaleLeft, MouseCursor.ResizeHorizontal);
         this.m_SelectionScaleLeft.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_SelectionScaleLeft.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Right, RectangleTool.ToolCoord.Left, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), DragMode.ScaleHorizontal, base.rippleTimeClutch);
                 return(true);
             }
             return(false);
         });
         this.m_SelectionScaleLeft.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_SelectionScaleLeft.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         });
         this.m_SelectionScaleLeft.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_SelectionScaleLeft.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
     if (this.m_SelectionScaleRight == null)
     {
         this.m_SelectionScaleRight             = new AreaManipulator(base.styles.rectangleToolScaleRight, MouseCursor.ResizeHorizontal);
         this.m_SelectionScaleRight.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_SelectionScaleRight.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Left, RectangleTool.ToolCoord.Right, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), DragMode.ScaleHorizontal, base.rippleTimeClutch);
                 return(true);
             }
             return(false);
         });
         this.m_SelectionScaleRight.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_SelectionScaleRight.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         });
         this.m_SelectionScaleRight.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_SelectionScaleRight.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
     if (this.m_SelectionScaleBottom == null)
     {
         this.m_SelectionScaleBottom             = new AreaManipulator(base.styles.rectangleToolScaleBottom, MouseCursor.ResizeVertical);
         this.m_SelectionScaleBottom.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_SelectionScaleBottom.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Top, RectangleTool.ToolCoord.Bottom, new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), DragMode.ScaleVertical, false);
                 return(true);
             }
             return(false);
         });
         this.m_SelectionScaleBottom.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_SelectionScaleBottom.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleValue(base.PixelToValue(evt.mousePosition.y));
             return(true);
         });
         this.m_SelectionScaleBottom.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_SelectionScaleBottom.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
     if (this.m_SelectionScaleTop == null)
     {
         this.m_SelectionScaleTop             = new AreaManipulator(base.styles.rectangleToolScaleTop, MouseCursor.ResizeVertical);
         this.m_SelectionScaleTop.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_SelectionScaleTop.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Bottom, RectangleTool.ToolCoord.Top, new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), DragMode.ScaleVertical, false);
                 return(true);
             }
             return(false);
         });
         this.m_SelectionScaleTop.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_SelectionScaleTop.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleValue(base.PixelToValue(evt.mousePosition.y));
             return(true);
         });
         this.m_SelectionScaleTop.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_SelectionScaleTop.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
 }
예제 #2
0
 public override void Initialize(TimeArea timeArea)
 {
     base.Initialize(timeArea);
     this.m_CurveEditor = (timeArea as CurveEditor);
     if (this.m_HBarLeft == null)
     {
         this.m_HBarLeft = new AreaManipulator(base.styles.rectangleToolHBarLeft, MouseCursor.ResizeHorizontal);
         AreaManipulator expr_3D = this.m_HBarLeft;
         expr_3D.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_3D.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Right, RectangleTool.ToolCoord.Left, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), CurveEditorRectangleTool.DragMode.ScaleHorizontal, base.rippleTimeClutch);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_64 = this.m_HBarLeft;
         expr_64.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_64.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         }));
         AreaManipulator expr_8B = this.m_HBarLeft;
         expr_8B.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_8B.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
     if (this.m_HBarRight == null)
     {
         this.m_HBarRight = new AreaManipulator(base.styles.rectangleToolHBarRight, MouseCursor.ResizeHorizontal);
         AreaManipulator expr_D6 = this.m_HBarRight;
         expr_D6.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_D6.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Left, RectangleTool.ToolCoord.Right, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), CurveEditorRectangleTool.DragMode.ScaleHorizontal, base.rippleTimeClutch);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_FD = this.m_HBarRight;
         expr_FD.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_FD.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         }));
         AreaManipulator expr_124 = this.m_HBarRight;
         expr_124.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_124.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
     if (this.m_HBar == null)
     {
         this.m_HBar = new AreaManipulator(base.styles.rectangleToolHBar, MouseCursor.MoveArrow);
         AreaManipulator expr_16F = this.m_HBar;
         expr_16F.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_16F.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), CurveEditorRectangleTool.DragMode.MoveHorizontal, base.rippleTimeClutch);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_196 = this.m_HBar;
         expr_196.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_196.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f));
             return(true);
         }));
         AreaManipulator expr_1BD = this.m_HBar;
         expr_1BD.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_1BD.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndMove();
             return(true);
         }));
     }
     if (this.m_VBarBottom == null)
     {
         this.m_VBarBottom = new AreaManipulator(base.styles.rectangleToolVBarBottom, MouseCursor.ResizeVertical);
         AreaManipulator expr_208 = this.m_VBarBottom;
         expr_208.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_208.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Top, RectangleTool.ToolCoord.Bottom, new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), CurveEditorRectangleTool.DragMode.ScaleVertical, false);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_22F = this.m_VBarBottom;
         expr_22F.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_22F.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleValue(base.PixelToValue(evt.mousePosition.y));
             return(true);
         }));
         AreaManipulator expr_256 = this.m_VBarBottom;
         expr_256.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_256.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
     if (this.m_VBarTop == null)
     {
         this.m_VBarTop = new AreaManipulator(base.styles.rectangleToolVBarTop, MouseCursor.ResizeVertical);
         AreaManipulator expr_2A1 = this.m_VBarTop;
         expr_2A1.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_2A1.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Bottom, RectangleTool.ToolCoord.Top, new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), CurveEditorRectangleTool.DragMode.ScaleVertical, false);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_2C8 = this.m_VBarTop;
         expr_2C8.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_2C8.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleValue(base.PixelToValue(evt.mousePosition.y));
             return(true);
         }));
         AreaManipulator expr_2EF = this.m_VBarTop;
         expr_2EF.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_2EF.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
     if (this.m_VBar == null)
     {
         this.m_VBar = new AreaManipulator(base.styles.rectangleToolVBar, MouseCursor.MoveArrow);
         AreaManipulator expr_33A = this.m_VBar;
         expr_33A.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_33A.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartMove(new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), CurveEditorRectangleTool.DragMode.MoveVertical, false);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_361 = this.m_VBar;
         expr_361.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_361.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnMove(new Vector2(0f, base.PixelToValue(evt.mousePosition.y)));
             return(true);
         }));
         AreaManipulator expr_388 = this.m_VBar;
         expr_388.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_388.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndMove();
             return(true);
         }));
     }
     if (this.m_SelectionBox == null)
     {
         this.m_SelectionBox = new AreaManipulator(base.styles.rectangleToolSelection, MouseCursor.MoveArrow);
         AreaManipulator expr_3D3 = this.m_SelectionBox;
         expr_3D3.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_3D3.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool flag = evt.shift || EditorGUI.actionKey;
             bool result;
             if ((!Mathf.Approximately(this.selectionBounds.size.x, 0f) || !Mathf.Approximately(this.selectionBounds.size.y, 0f)) && !flag && this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), base.PixelToValue(evt.mousePosition.y)), (!base.rippleTimeClutch) ? CurveEditorRectangleTool.DragMode.MoveBothAxis : CurveEditorRectangleTool.DragMode.MoveHorizontal, base.rippleTimeClutch);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_3FA = this.m_SelectionBox;
         expr_3FA.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_3FA.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), base.PixelToValue(evt.mousePosition.y)));
             return(true);
         }));
         AreaManipulator expr_421 = this.m_SelectionBox;
         expr_421.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_421.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndMove();
             return(true);
         }));
     }
     if (this.m_SelectionScaleLeft == null)
     {
         this.m_SelectionScaleLeft = new AreaManipulator(base.styles.rectangleToolScaleLeft, MouseCursor.ResizeHorizontal);
         AreaManipulator expr_46C = this.m_SelectionScaleLeft;
         expr_46C.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_46C.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Right, RectangleTool.ToolCoord.Left, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), CurveEditorRectangleTool.DragMode.ScaleHorizontal, base.rippleTimeClutch);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_493 = this.m_SelectionScaleLeft;
         expr_493.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_493.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         }));
         AreaManipulator expr_4BA = this.m_SelectionScaleLeft;
         expr_4BA.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_4BA.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
     if (this.m_SelectionScaleRight == null)
     {
         this.m_SelectionScaleRight = new AreaManipulator(base.styles.rectangleToolScaleRight, MouseCursor.ResizeHorizontal);
         AreaManipulator expr_505 = this.m_SelectionScaleRight;
         expr_505.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_505.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Left, RectangleTool.ToolCoord.Right, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), CurveEditorRectangleTool.DragMode.ScaleHorizontal, base.rippleTimeClutch);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_52C = this.m_SelectionScaleRight;
         expr_52C.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_52C.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         }));
         AreaManipulator expr_553 = this.m_SelectionScaleRight;
         expr_553.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_553.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
     if (this.m_SelectionScaleBottom == null)
     {
         this.m_SelectionScaleBottom = new AreaManipulator(base.styles.rectangleToolScaleBottom, MouseCursor.ResizeVertical);
         AreaManipulator expr_59E = this.m_SelectionScaleBottom;
         expr_59E.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_59E.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Top, RectangleTool.ToolCoord.Bottom, new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), CurveEditorRectangleTool.DragMode.ScaleVertical, false);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_5C5 = this.m_SelectionScaleBottom;
         expr_5C5.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_5C5.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleValue(base.PixelToValue(evt.mousePosition.y));
             return(true);
         }));
         AreaManipulator expr_5EC = this.m_SelectionScaleBottom;
         expr_5EC.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_5EC.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
     if (this.m_SelectionScaleTop == null)
     {
         this.m_SelectionScaleTop = new AreaManipulator(base.styles.rectangleToolScaleTop, MouseCursor.ResizeVertical);
         AreaManipulator expr_637 = this.m_SelectionScaleTop;
         expr_637.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_637.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Bottom, RectangleTool.ToolCoord.Top, new Vector2(0f, base.PixelToValue(evt.mousePosition.y)), CurveEditorRectangleTool.DragMode.ScaleVertical, false);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_65E = this.m_SelectionScaleTop;
         expr_65E.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_65E.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleValue(base.PixelToValue(evt.mousePosition.y));
             return(true);
         }));
         AreaManipulator expr_685 = this.m_SelectionScaleTop;
         expr_685.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_685.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
 }
예제 #3
0
        public override void Initialize(TimeArea timeArea)
        {
            base.Initialize(timeArea);
            m_DopeSheetEditor = timeArea as DopeSheetEditor;
            m_State           = m_DopeSheetEditor.state;

            if (m_SelectionBoxes == null)
            {
                m_SelectionBoxes = new AreaManipulator[2];

                for (int i = 0; i < 2; ++i)
                {
                    m_SelectionBoxes[i] = new AreaManipulator(styles.rectangleToolSelection, MouseCursor.MoveArrow);

                    m_SelectionBoxes[i].onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                    {
                        bool curveEditorOverride = evt.shift || EditorGUI.actionKey;
                        if (!curveEditorOverride && hasSelection && manipulator.rect.Contains(evt.mousePosition))
                        {
                            OnStartMove(new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0.0f), rippleTimeClutch);
                            return(true);
                        }

                        return(false);
                    };
                    m_SelectionBoxes[i].onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                    {
                        OnMove(new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0.0f));
                        return(true);
                    };
                    m_SelectionBoxes[i].onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                    {
                        OnEndMove();
                        return(true);
                    };
                }
            }

            if (m_SelectionScaleLeft == null)
            {
                m_SelectionScaleLeft = new AreaManipulator(styles.dopesheetScaleLeft, MouseCursor.ResizeHorizontal);

                m_SelectionScaleLeft.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Right, ToolCoord.Left, new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0f), rippleTimeClutch);
                        return(true);
                    }

                    return(false);
                };
                m_SelectionScaleLeft.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleTime(PixelToTime(evt.mousePosition.x, frameRate));
                    return(true);
                };
                m_SelectionScaleLeft.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }

            if (m_SelectionScaleRight == null)
            {
                m_SelectionScaleRight = new AreaManipulator(styles.dopesheetScaleRight, MouseCursor.ResizeHorizontal);

                m_SelectionScaleRight.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Left, ToolCoord.Right, new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0f), rippleTimeClutch);
                        return(true);
                    }

                    return(false);
                };
                m_SelectionScaleRight.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleTime(PixelToTime(evt.mousePosition.x, frameRate));
                    return(true);
                };
                m_SelectionScaleRight.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }
        }
예제 #4
0
        public override void Initialize(TimeArea timeArea)
        {
            base.Initialize(timeArea);
            m_CurveEditor = timeArea as CurveEditor;

            if (m_HBarLeft == null)
            {
                m_HBarLeft = new AreaManipulator(styles.rectangleToolHBarLeft, MouseCursor.ResizeHorizontal);

                m_HBarLeft.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Right, ToolCoord.Left, new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0f), DragMode.ScaleHorizontal, rippleTimeClutch);
                        return(true);
                    }

                    return(false);
                };
                m_HBarLeft.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleTime(PixelToTime(evt.mousePosition.x, frameRate));
                    return(true);
                };
                m_HBarLeft.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }

            if (m_HBarRight == null)
            {
                m_HBarRight = new AreaManipulator(styles.rectangleToolHBarRight, MouseCursor.ResizeHorizontal);

                m_HBarRight.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Left, ToolCoord.Right, new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0f), DragMode.ScaleHorizontal, rippleTimeClutch);
                        return(true);
                    }

                    return(false);
                };
                m_HBarRight.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleTime(PixelToTime(evt.mousePosition.x, frameRate));
                    return(true);
                };
                m_HBarRight.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }

            if (m_HBar == null)
            {
                m_HBar = new AreaManipulator(styles.rectangleToolHBar, MouseCursor.MoveArrow);

                m_HBar.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartMove(new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0f), DragMode.MoveHorizontal, rippleTimeClutch);
                        return(true);
                    }

                    return(false);
                };
                m_HBar.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnMove(new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0f));
                    return(true);
                };
                m_HBar.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndMove();
                    return(true);
                };
            }

            if (m_VBarBottom == null)
            {
                m_VBarBottom = new AreaManipulator(styles.rectangleToolVBarBottom, MouseCursor.ResizeVertical);

                m_VBarBottom.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Top, ToolCoord.Bottom, new Vector2(0f, PixelToValue(evt.mousePosition.y)), DragMode.ScaleVertical, false);
                        return(true);
                    }

                    return(false);
                };
                m_VBarBottom.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleValue(PixelToValue(evt.mousePosition.y));
                    return(true);
                };
                m_VBarBottom.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }

            if (m_VBarTop == null)
            {
                m_VBarTop = new AreaManipulator(styles.rectangleToolVBarTop, MouseCursor.ResizeVertical);

                m_VBarTop.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Bottom, ToolCoord.Top, new Vector2(0f, PixelToValue(evt.mousePosition.y)), DragMode.ScaleVertical, false);
                        return(true);
                    }

                    return(false);
                };
                m_VBarTop.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleValue(PixelToValue(evt.mousePosition.y));
                    return(true);
                };
                m_VBarTop.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }

            if (m_VBar == null)
            {
                m_VBar = new AreaManipulator(styles.rectangleToolVBar, MouseCursor.MoveArrow);

                m_VBar.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartMove(new Vector2(0f, PixelToValue(evt.mousePosition.y)), DragMode.MoveVertical, false);
                        return(true);
                    }

                    return(false);
                };
                m_VBar.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnMove(new Vector2(0f, PixelToValue(evt.mousePosition.y)));
                    return(true);
                };
                m_VBar.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndMove();
                    return(true);
                };
            }

            if (m_SelectionBox == null)
            {
                m_SelectionBox = new AreaManipulator(styles.rectangleToolSelection, MouseCursor.MoveArrow);

                m_SelectionBox.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    bool curveEditorOverride = evt.shift || EditorGUI.actionKey;
                    if (!curveEditorOverride && hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartMove(new Vector2(PixelToTime(evt.mousePosition.x, frameRate), PixelToValue(evt.mousePosition.y)), rippleTimeClutch ? DragMode.MoveHorizontal : DragMode.MoveBothAxis, rippleTimeClutch);
                        return(true);
                    }

                    return(false);
                };
                m_SelectionBox.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    // Only drag along x OR y when shift is held down
                    if (evt.shift && m_DragMode == DragMode.MoveBothAxis)
                    {
                        float deltaX = evt.mousePosition.x - TimeToPixel(m_Previous.x);
                        float deltaY = evt.mousePosition.y - ValueToPixel(m_Previous.y);
                        m_DragMode = Mathf.Abs(deltaX) > Mathf.Abs(deltaY) ? DragMode.MoveHorizontal : DragMode.MoveVertical;
                    }

                    float posX = ((m_DragMode & DragMode.MoveHorizontal) != 0) ? PixelToTime(evt.mousePosition.x, frameRate) : m_Previous.x;
                    float posY = ((m_DragMode & DragMode.MoveVertical) != 0) ? PixelToValue(evt.mousePosition.y) : m_Previous.y;

                    OnMove(new Vector2(posX, posY));
                    return(true);
                };
                m_SelectionBox.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndMove();
                    return(true);
                };
            }

            if (m_SelectionScaleLeft == null)
            {
                m_SelectionScaleLeft = new AreaManipulator(styles.rectangleToolScaleLeft, MouseCursor.ResizeHorizontal);

                m_SelectionScaleLeft.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Right, ToolCoord.Left, new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0f), DragMode.ScaleHorizontal, rippleTimeClutch);
                        return(true);
                    }

                    return(false);
                };
                m_SelectionScaleLeft.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleTime(PixelToTime(evt.mousePosition.x, frameRate));
                    return(true);
                };
                m_SelectionScaleLeft.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }

            if (m_SelectionScaleRight == null)
            {
                m_SelectionScaleRight = new AreaManipulator(styles.rectangleToolScaleRight, MouseCursor.ResizeHorizontal);

                m_SelectionScaleRight.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Left, ToolCoord.Right, new Vector2(PixelToTime(evt.mousePosition.x, frameRate), 0f), DragMode.ScaleHorizontal, rippleTimeClutch);
                        return(true);
                    }

                    return(false);
                };
                m_SelectionScaleRight.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleTime(PixelToTime(evt.mousePosition.x, frameRate));
                    return(true);
                };
                m_SelectionScaleRight.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }

            if (m_SelectionScaleBottom == null)
            {
                m_SelectionScaleBottom = new AreaManipulator(styles.rectangleToolScaleBottom, MouseCursor.ResizeVertical);

                m_SelectionScaleBottom.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Top, ToolCoord.Bottom, new Vector2(0f, PixelToValue(evt.mousePosition.y)), DragMode.ScaleVertical, false);
                        return(true);
                    }

                    return(false);
                };
                m_SelectionScaleBottom.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleValue(PixelToValue(evt.mousePosition.y));
                    return(true);
                };
                m_SelectionScaleBottom.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }

            if (m_SelectionScaleTop == null)
            {
                m_SelectionScaleTop = new AreaManipulator(styles.rectangleToolScaleTop, MouseCursor.ResizeVertical);

                m_SelectionScaleTop.onStartDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    if (hasSelection && manipulator.rect.Contains(evt.mousePosition))
                    {
                        OnStartScale(ToolCoord.Bottom, ToolCoord.Top, new Vector2(0f, PixelToValue(evt.mousePosition.y)), DragMode.ScaleVertical, false);
                        return(true);
                    }

                    return(false);
                };
                m_SelectionScaleTop.onDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnScaleValue(PixelToValue(evt.mousePosition.y));
                    return(true);
                };
                m_SelectionScaleTop.onEndDrag += (AnimationWindowManipulator manipulator, Event evt) =>
                {
                    OnEndScale();
                    return(true);
                };
            }
        }
 public override void Initialize(TimeArea timeArea)
 {
     base.Initialize(timeArea);
     this.m_DopeSheetEditor = (timeArea as DopeSheetEditor);
     this.m_State           = this.m_DopeSheetEditor.state;
     if (this.m_SelectionBoxes == null)
     {
         this.m_SelectionBoxes = new AreaManipulator[2];
         for (int i = 0; i < 2; i++)
         {
             this.m_SelectionBoxes[i] = new AreaManipulator(base.styles.rectangleToolSelection, MouseCursor.MoveArrow);
             AreaManipulator expr_66 = this.m_SelectionBoxes[i];
             expr_66.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_66.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
             {
                 bool result;
                 if (!evt.shift && !EditorGUI.actionKey && this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
                 {
                     this.OnStartMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), base.rippleTimeClutch);
                     result = true;
                 }
                 else
                 {
                     result = false;
                 }
                 return(result);
             }));
             AreaManipulator expr_8F = this.m_SelectionBoxes[i];
             expr_8F.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_8F.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
             {
                 this.OnMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f));
                 return(true);
             }));
             AreaManipulator expr_B8 = this.m_SelectionBoxes[i];
             expr_B8.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_B8.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
             {
                 this.OnEndMove();
                 return(true);
             }));
         }
     }
     if (this.m_SelectionScaleLeft == null)
     {
         this.m_SelectionScaleLeft = new AreaManipulator(base.styles.dopesheetScaleLeft, MouseCursor.ResizeHorizontal);
         AreaManipulator expr_10F = this.m_SelectionScaleLeft;
         expr_10F.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_10F.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Right, RectangleTool.ToolCoord.Left, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), base.rippleTimeClutch);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_136 = this.m_SelectionScaleLeft;
         expr_136.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_136.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         }));
         AreaManipulator expr_15D = this.m_SelectionScaleLeft;
         expr_15D.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_15D.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
     if (this.m_SelectionScaleRight == null)
     {
         this.m_SelectionScaleRight = new AreaManipulator(base.styles.dopesheetScaleRight, MouseCursor.ResizeHorizontal);
         AreaManipulator expr_1A8 = this.m_SelectionScaleRight;
         expr_1A8.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(expr_1A8.onStartDrag, new AnimationWindowManipulator.OnStartDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             bool result;
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Left, RectangleTool.ToolCoord.Right, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), base.rippleTimeClutch);
                 result = true;
             }
             else
             {
                 result = false;
             }
             return(result);
         }));
         AreaManipulator expr_1CF = this.m_SelectionScaleRight;
         expr_1CF.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(expr_1CF.onDrag, new AnimationWindowManipulator.OnDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         }));
         AreaManipulator expr_1F6 = this.m_SelectionScaleRight;
         expr_1F6.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(expr_1F6.onEndDrag, new AnimationWindowManipulator.OnEndDragDelegate(delegate(AnimationWindowManipulator manipulator, Event evt)
         {
             this.OnEndScale();
             return(true);
         }));
     }
 }
 public override void Initialize(TimeArea timeArea)
 {
     base.Initialize(timeArea);
     this.m_DopeSheetEditor = timeArea as DopeSheetEditor;
     this.m_State           = this.m_DopeSheetEditor.state;
     if (this.m_SelectionBoxes == null)
     {
         this.m_SelectionBoxes = new AreaManipulator[2];
         for (int i = 0; i < 2; i++)
         {
             this.m_SelectionBoxes[i] = new AreaManipulator(base.styles.rectangleToolSelection, MouseCursor.MoveArrow);
             AreaManipulator manipulator1 = this.m_SelectionBoxes[i];
             manipulator1.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(manipulator1.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
                 if ((!(evt.shift || EditorGUI.actionKey) && this.hasSelection) && manipulator.rect.Contains(evt.mousePosition))
                 {
                     this.OnStartMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), base.rippleTimeClutch);
                     return(true);
                 }
                 return(false);
             });
             AreaManipulator manipulator2 = this.m_SelectionBoxes[i];
             manipulator2.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(manipulator2.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
                 this.OnMove(new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f));
                 return(true);
             });
             AreaManipulator manipulator3 = this.m_SelectionBoxes[i];
             manipulator3.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(manipulator3.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
                 this.OnEndMove();
                 return(true);
             });
         }
     }
     if (this.m_SelectionScaleLeft == null)
     {
         this.m_SelectionScaleLeft             = new AreaManipulator(base.styles.dopesheetScaleLeft, MouseCursor.ResizeHorizontal);
         this.m_SelectionScaleLeft.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_SelectionScaleLeft.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Right, RectangleTool.ToolCoord.Left, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), base.rippleTimeClutch);
                 return(true);
             }
             return(false);
         });
         this.m_SelectionScaleLeft.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_SelectionScaleLeft.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         });
         this.m_SelectionScaleLeft.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_SelectionScaleLeft.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
     if (this.m_SelectionScaleRight == null)
     {
         this.m_SelectionScaleRight             = new AreaManipulator(base.styles.dopesheetScaleRight, MouseCursor.ResizeHorizontal);
         this.m_SelectionScaleRight.onStartDrag = (AnimationWindowManipulator.OnStartDragDelegate) Delegate.Combine(this.m_SelectionScaleRight.onStartDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             if (this.hasSelection && manipulator.rect.Contains(evt.mousePosition))
             {
                 this.OnStartScale(RectangleTool.ToolCoord.Left, RectangleTool.ToolCoord.Right, new Vector2(base.PixelToTime(evt.mousePosition.x, this.frameRate), 0f), base.rippleTimeClutch);
                 return(true);
             }
             return(false);
         });
         this.m_SelectionScaleRight.onDrag = (AnimationWindowManipulator.OnDragDelegate) Delegate.Combine(this.m_SelectionScaleRight.onDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnScaleTime(base.PixelToTime(evt.mousePosition.x, this.frameRate));
             return(true);
         });
         this.m_SelectionScaleRight.onEndDrag = (AnimationWindowManipulator.OnEndDragDelegate) Delegate.Combine(this.m_SelectionScaleRight.onEndDrag, delegate(AnimationWindowManipulator manipulator, Event evt) {
             this.OnEndScale();
             return(true);
         });
     }
 }