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;
});
}
}