protected override void Update()
    {
        base.Update();

        if (Input.GetMouseButton(0))
        {
            GameObject currentMouseHover = Mouse.currentSelectableUnderMouse;
            if (currentMouseHover)
            {
                SongObjectController soController = currentMouseHover.GetComponent <SongObjectController>();
                if (soController && soController.GetSongObject() != null)       // Dunno why song object would ever be null, but may as well be safe
                {
                    SongObject songObject = soController.GetSongObject();
                    if (ShortcutInput.GetInput(Shortcut.ChordSelect) && songObject.classID == (int)SongObject.ID.Note)
                    {
                        foreach (Note note in ((Note)songObject).chord)
                        {
                            dragEraseHistory.Add(note);
                        }
                    }
                    else if ((songObject.classID != (int)SongObject.ID.BPM && songObject.classID != (int)SongObject.ID.TimeSignature) || songObject.tick != 0)
                    {
                        dragEraseHistory.Add(songObject);
                    }

                    ExecuteCurrentDeletes();
                }
            }
        }

        if (Input.GetMouseButtonUp(0))
        {
            dragEraseHistory.Clear();
        }
    }
Example #2
0
    void DeleteSongObject(SongObjectController soController)
    {
        if (soController && soController.GetSongObject() != null)       // Dunno why song object would ever be null, but may as well be safe
        {
            SongObject songObject = soController.GetSongObject();
            if (MSChartEditorInput.GetInput(MSChartEditorInputActions.ChordSelect) && songObject.classID == (int)SongObject.ID.Note)
            {
                foreach (Note note in ((Note)songObject).chord)
                {
                    dragEraseHistory.Add(note);
                }
            }
            else if ((songObject.classID != (int)SongObject.ID.BPM && songObject.classID != (int)SongObject.ID.TimeSignature) || songObject.tick != 0)
            {
                dragEraseHistory.Add(songObject);
            }

            ExecuteCurrentDeletes();
        }
    }