public override void OnDrag(Vector2 pos)
        {
            int frame = FrameUtil.PosToFrame(pos.x);

            if (!hasModify)
            {
                if (frame != hitResult.Frame)
                {
                    hasModify = true;
                    view.RegistUndo("move clip");
                }
            }
            if (hasModify)
            {
                if (hitResult.HitPart == FrameClipHitPartType.LeftCtrl)
                {
                    foreach (var clipRef in view.SelectedClips)
                    {
                        int startFrame = clipRef.Clip.StartFrame - (frame - lastFrame);
                        startFrame = Mathf.Clamp(startFrame, 0, view.FrameCount - 1);
                        clipRef.Clip.StartFrame = startFrame;
                    }
                }
                else if (hitResult.HitPart == FrameClipHitPartType.RightCtrl)
                {
                }
                lastFrame = frame;
                TrackUtil.UpdateAllTrack(view.Asset);
            }
        }
Exemple #2
0
 public static void RemoveSelectedClip(this FrameLineView view)
 {
     view.RegistUndo("remove clips");
     foreach (var clipRef in view.SelectedClips)
     {
         view.Asset.RemoveClip(clipRef);
     }
     view.SelectedClips.Clear();
     TrackUtil.UpdateAllTrack(view.Asset);
 }
Exemple #3
0
 public static void MoveSelectedClip(this FrameLineView view, int offsetFrame)
 {
     foreach (var clipRef in view.SelectedClips)
     {
         int startFrame = clipRef.Clip.StartFrame - offsetFrame;
         startFrame = Mathf.Clamp(startFrame, 0, view.FrameCount - 1);
         clipRef.Clip.StartFrame = startFrame;
     }
     TrackUtil.UpdateAllTrack(view.Asset);
 }