Ejemplo n.º 1
0
        void Awake()
        {
            this._resizableRects =
                new HorizontalResizableRects(() => new Rect(0, 0, this.position.width, this.position.height),
                                             new[] { 300f });
            this._timelineRect = new TimelineRect(() => _resizableRects.rects[1]);
            this._timelineRect.onDrawTracksLeftSideCallback = () =>
                                                              TimelinableEditorWindowUtil.OnDrawTracksLeftSideCallback(_sequence, _timelineRect);
            this._timelineRect.onDrawTracksRightSideCallback = () =>
                                                               TimelinableEditorWindowUtil.OnDrawTracksRightSideCallback(_sequence, _timelineRect);

            this._timelineRect.isMouseDownOfSelectedItem = (mousePosition) =>
                                                           TimelinableEditorWindowUtil.IsMouseDownOfSelectedItem(mousePosition, _sequence);
            this._timelineRect.tryToSelectUnselectedItemCallback = (mousePosition) =>
                                                                   TimelinableEditorWindowUtil.TryToSelectUnselectedItemCallback(mousePosition, _sequence);
            this._timelineRect.updateSelectedItemsCallback = (selectingRect) =>
                                                             TimelinableEditorWindowUtil.UpdateSelectedItemsCallback(selectingRect, _sequence);
            this._timelineRect.onDraggingSelectedCallback = (deltaDuration) =>
                                                            TimelinableEditorWindowUtil.OnDraggingSelectedCallback(deltaDuration, _sequence, _timelineRect.playTime);
            this._timelineRect.isHasSelectedItem = () => TimelinableEditorWindowUtil.IsHasSelectedItem(_sequence);

            this._timelineRect.onMouseRightButtonClickCallback = (positionRect) =>
                                                                 TimelinableEditorWindowUtil.OnMouseRightButtonClickCallback(positionRect, _sequence.tracks);

            this._timelineRect.onDoEditorCommandCallback = (editorCommand) =>
                                                           TimelinableEditorWindowUtil.OnDoEditorCommandCallback(editorCommand, _sequence.tracks);

            this._timelineRect.onPlayTimeChangeCallback = (playTime) =>
                                                          TimelinableEditorWindowUtil.OnPlayTimeChangeCallback(_sequence, playTime);
        }
 void DrawLeft()
 {
     using (new GUILayout.AreaScope(this._resizableRects.rects[0]))
     {
         GUILayout.Space(20);
         using (new GUILayoutBeginVerticalScope(EditorStyles.helpBox))
         {
             TimelinableEditorWindowUtil.DrawGUISetting_Sequence(ref _sequence);
             if (_sequence == null)
             {
                 return;
             }
             _sequence.DrawGUISetting_Detail();
         }
         if (_sequence.tracks.Length <= 0)
         {
             return;
         }
         _sequence.DrawGUISetting_Tracks(_timelineRect.playTime);
     }
 }