private void OnStartMove(Vector2 position, CurveEditorRectangleTool.DragMode dragMode, bool rippleTime) { Bounds selectionBounds = this.selectionBounds; this.m_DragMode = dragMode; this.m_Previous = position; this.m_RippleTime = rippleTime; this.m_RippleTimeStart = selectionBounds.min.x; this.m_RippleTimeEnd = selectionBounds.max.x; this.m_CurveEditor.StartLiveEdit(); }
private void OnStartScale(RectangleTool.ToolCoord pivotCoord, RectangleTool.ToolCoord pickedCoord, Vector2 mousePos, CurveEditorRectangleTool.DragMode dragMode, bool rippleTime) { Bounds selectionBounds = this.selectionBounds; this.m_DragMode = dragMode; this.m_Pivot = base.ToolCoordToPosition(pivotCoord, selectionBounds); this.m_Previous = base.ToolCoordToPosition(pickedCoord, selectionBounds); this.m_MouseOffset = mousePos - this.m_Previous; this.m_RippleTime = rippleTime; this.m_RippleTimeStart = selectionBounds.min.x; this.m_RippleTimeEnd = selectionBounds.max.x; this.m_CurveEditor.StartLiveEdit(); }
private void OnEndMove() { this.m_CurveEditor.EndLiveEdit(); this.m_DragMode = CurveEditorRectangleTool.DragMode.None; GUI.changed = true; }
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 result; if (!evt.shift && !EditorGUI.actionKey && 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) { if (evt.shift && this.m_DragMode == CurveEditorRectangleTool.DragMode.MoveBothAxis) { float f = evt.mousePosition.x - base.TimeToPixel(this.m_Previous.x); float f2 = evt.mousePosition.y - base.ValueToPixel(this.m_Previous.y); this.m_DragMode = ((Mathf.Abs(f) <= Mathf.Abs(f2)) ? CurveEditorRectangleTool.DragMode.MoveVertical : CurveEditorRectangleTool.DragMode.MoveHorizontal); } float x = ((this.m_DragMode & CurveEditorRectangleTool.DragMode.MoveHorizontal) == CurveEditorRectangleTool.DragMode.None) ? this.m_Previous.x : base.PixelToTime(evt.mousePosition.x, this.frameRate); float y = ((this.m_DragMode & CurveEditorRectangleTool.DragMode.MoveVertical) == CurveEditorRectangleTool.DragMode.None) ? this.m_Previous.y : base.PixelToValue(evt.mousePosition.y); this.OnMove(new Vector2(x, 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); })); } }