private List <Note> GetFollowingNotesOrEmptyListIfDeactivated(List <Note> selectedNotes)
 {
     if (settings.SongEditorSettings.AdjustFollowingNotes)
     {
         return(SongMetaUtils.GetFollowingNotes(songMeta, selectedNotes));
     }
     else
     {
         return(new List <Note>());
     }
 }
示例#2
0
    private void AdjustFollowingNotes(EKeyboardModifier modifier, Vector2 arrowKeyDirection, List <Note> selectedNotes)
    {
        // Moving is applied to following notes as well.
        // When extending / shrinking the right side, then the following notes are move to compensate.
        List <Note> followingNotes = SongMetaUtils.GetFollowingNotes(songMeta, selectedNotes);

        foreach (Note note in followingNotes)
        {
            // Moved with Shift. The following notes are moved as well.
            if (modifier == EKeyboardModifier.Shift)
            {
                note.MoveHorizontal((int)arrowKeyDirection.x);
                note.MoveVertical((int)arrowKeyDirection.y);
            }

            // Extended right side with Alt. The following notes must be moved to compensate.
            if (modifier == EKeyboardModifier.Alt)
            {
                note.MoveHorizontal((int)arrowKeyDirection.x);
            }
        }
    }
示例#3
0
    public void OnBeginDrag(NoteAreaDragEvent dragEvent)
    {
        if (dragEvent.GeneralDragEvent.InputButton != PointerEventData.InputButton.Left)
        {
            CancelDrag();
            return;
        }

        isCanceled = false;
        GameObject   raycastTarget   = dragEvent.GeneralDragEvent.RaycastResultsDragStart.Select(it => it.gameObject).FirstOrDefault();
        EditorUiNote dragStartUiNote = raycastTarget.GetComponent <EditorUiNote>();

        if (dragStartUiNote == null)
        {
            CancelDrag();
            return;
        }

        if (!selectionController.IsSelected(dragStartUiNote.Note))
        {
            selectionController.SetSelection(new List <EditorUiNote> {
                dragStartUiNote
            });
        }

        dragAction = GetDragAction(dragStartUiNote, dragEvent);

        selectedNotes = selectionController.GetSelectedNotes();
        if (settings.SongEditorSettings.AdjustFollowingNotes)
        {
            followingNotes = SongMetaUtils.GetFollowingNotes(songMeta, selectedNotes);
        }
        else
        {
            followingNotes.Clear();
        }

        CreateSnapshot(selectedNotes.Union(followingNotes));
    }