예제 #1
0
        public void MirrorME()
        {
            var notesContainer = BeatmapObjectContainerCollection.GetCollectionForType(BeatmapObject.Type.NOTE);
            var root           = notesContainer.transform.root;
            var notePlacement  = root.GetComponentInChildren <NotePlacement>();

            var noteA = new BeatmapNote(2, -2345, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_TYPE_A, BeatmapNote.NOTE_CUT_DIRECTION_LEFT);

            notePlacement.queuedData  = noteA;
            notePlacement.RoundedTime = notePlacement.queuedData._time;
            notePlacement.ApplyToMap();

            SelectionController.Select(noteA);

            _mirror.Mirror();
            NoteTest.CheckNote(notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_B, 5345, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_RIGHT);

            // Undo mirror
            _actionContainer.Undo();
            NoteTest.CheckNote(notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_A, -2345, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_LEFT);
        }
예제 #2
0
        public void MirrorInTime()
        {
            _mirror.MirrorTime();

            // Check we can still delete our objects
            var toDelete = _notesContainer.UnsortedObjects.FirstOrDefault();

            _notesContainer.DeleteObject(toDelete);
            Assert.AreEqual(1, _notesContainer.LoadedObjects.Count);

            _actionContainer.Undo();

            Assert.AreEqual(2, _notesContainer.LoadedObjects.Count);

            NoteTest.CheckNote(_notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_B, BeatmapNote.LINE_INDEX_FAR_RIGHT, BeatmapNote.LINE_LAYER_TOP, BeatmapNote.NOTE_CUT_DIRECTION_UP_RIGHT);
            NoteTest.CheckNote(_notesContainer, 1, 3, BeatmapNote.NOTE_TYPE_A, BeatmapNote.LINE_INDEX_FAR_LEFT, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_LEFT);

            // Undo mirror
            _actionContainer.Undo();

            NoteTest.CheckNote(_notesContainer, 0, 2, BeatmapNote.NOTE_TYPE_A, BeatmapNote.LINE_INDEX_FAR_LEFT, BeatmapNote.LINE_LAYER_BOTTOM, BeatmapNote.NOTE_CUT_DIRECTION_LEFT);
            NoteTest.CheckNote(_notesContainer, 1, 3, BeatmapNote.NOTE_TYPE_B, BeatmapNote.LINE_INDEX_FAR_RIGHT, BeatmapNote.LINE_LAYER_TOP, BeatmapNote.NOTE_CUT_DIRECTION_UP_RIGHT);
        }
예제 #3
0
    void GlobalKeybinds()
    {
        if (Input.GetKeyDown(KeyCode.Tab))
        {
            workflowToggle.UpdateWorkflowGroup();
        }
        if (CtrlHeld)
        {
            if (Input.GetKeyDown(KeyCode.S) && !Input.GetMouseButton(1))
            {
                autosave.Save();
            }
            if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                laserSpeed.text = "1";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha2))
            {
                laserSpeed.text = "2";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha3))
            {
                laserSpeed.text = "3";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha4))
            {
                laserSpeed.text = "4";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha5))
            {
                laserSpeed.text = "5";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha6))
            {
                laserSpeed.text = "6";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha7))
            {
                laserSpeed.text = "7";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha8))
            {
                laserSpeed.text = "8";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha9))
            {
                laserSpeed.text = "9";
            }
            else if (Input.GetKeyDown(KeyCode.Alpha0))
            {
                laserSpeed.text = "0";
            }

            if (Input.GetKeyDown(KeyCode.Z) || (ShiftHeld && Input.GetKeyDown(KeyCode.Y)))
            {
                actionContainer.Undo();
            }
            else if (Input.GetKeyDown(KeyCode.Y) || (ShiftHeld && Input.GetKeyDown(KeyCode.Z)))
            {
                actionContainer.Redo();
            }


            if (Input.GetKeyDown(KeyCode.V) && SelectionController.HasCopiedObjects())
            {
                sc.Paste();
            }
        }
        if (Input.GetKeyDown(KeyCode.F11) && !Application.isEditor)
        {
            Screen.fullScreen = !Screen.fullScreen;
        }
        //if (Input.GetKeyDown(KeyCode.Z) || (ShiftHeld && Input.GetKeyDown(KeyCode.Y))) undoRedo.Undo();
        //if (Input.GetKeyDown(KeyCode.Y) || (ShiftHeld && Input.GetKeyDown(KeyCode.Z))) undoRedo.Redo();
    }