protected override bool DoubleClick(Event evt, WindowState state)
        {
            if (evt.button != 0)
            {
                return(false);
            }

            var trackGUI = PickerUtils.PickedTrackBaseGUI();

            if (trackGUI == null)
            {
                return(false);
            }

            return(EditTrackInAnimationWindow.Do(state, trackGUI.track));
        }
Example #2
0
 public override void Init(IControl parent)
 {
     parent.DoubleClick += delegate(object target, Event evt, TimelineWindow.TimelineState state)
     {
         bool result;
         if (evt.get_button() != 0)
         {
             result = base.IgnoreEvent();
         }
         else
         {
             TimelineTrackBaseGUI timelineTrackBaseGUI = target as TimelineTrackBaseGUI;
             result = EditTrackInAnimationWindow.Do(state, timelineTrackBaseGUI.track);
         }
         return(result);
     };
 }
Example #3
0
        protected override bool DoubleClick(Event evt, WindowState state)
        {
            if (evt.button != 0)
            {
                return(false);
            }

            var trackGUI = PickerUtils.FirstPickedElementOfType <TimelineTrackBaseGUI>();

            if (trackGUI == null)
            {
                return(false);
            }

            // Double-click is only available for AnimationTracks: it conflicts with selection mechanics on other tracks
            if ((trackGUI.track as AnimationTrack) == null)
            {
                return(false);
            }

            return(EditTrackInAnimationWindow.Do(state, trackGUI.track));
        }
Example #4
0
 public override bool Execute(TimelineWindow.TimelineState state, TrackAsset[] tracks)
 {
     return(EditTrackInAnimationWindow.Do(state, tracks[0]));
 }
Example #5
0
        public static bool Do(TimelineWindow.TimelineState state, TrackAsset track)
        {
            AnimationTrack animationTrack = track as AnimationTrack;
            bool           result;

            if (animationTrack == null)
            {
                result = false;
            }
            else if (!animationTrack.CanConvertToClipMode())
            {
                result = false;
            }
            else
            {
                Component bindingForTrack = state.GetBindingForTrack(animationTrack);
                TimelineWindowTimeControl timeController = TimelineAnimationUtilities.CreateTimeController(state, EditTrackInAnimationWindow.CreateTimeControlClipData(animationTrack));
                TimelineAnimationUtilities.EditAnimationClipWithTimeController(animationTrack.animClip, timeController, (!(bindingForTrack != null)) ? null : bindingForTrack.get_gameObject());
                result = true;
            }
            return(result);
        }