public DopeSheetSelectionRect(DopeSheetEditor owner)
 {
   this.owner = owner;
 }
Esempio n. 2
0
 private void InitializeDopeSheet()
 {
   this.m_DopeSheet = new DopeSheetEditor(this.m_OwnerWindow);
   this.m_DopeSheet.SetTickMarkerRanges();
   this.m_DopeSheet.hSlider = true;
   this.m_DopeSheet.shownArea = new Rect(1f, 1f, 1f, 1f);
   this.m_DopeSheet.rect = new Rect(0.0f, 0.0f, this.contentWidth, 100f);
   this.m_DopeSheet.hTicks.SetTickModulosForFrameRate(this.m_State.frameRate);
 }
		private void InitAllViews()
		{
			if (this.m_Hierarchy == null)
			{
				this.m_Hierarchy = new AnimationWindowHierarchy(this.state, this, new Rect(0f, 0f, 1f, 1f));
			}
			if (this.m_DopeSheetEditor == null)
			{
				this.m_DopeSheetEditor = new DopeSheetEditor(this.state, this);
			}
			if (this.m_AnimationEventTimeLine == null)
			{
				this.m_AnimationEventTimeLine = new AnimationEventTimeLine(this);
			}
		}
 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;
         });
     }
 }