/** * @brief Handles when a note panel is selected for editing. * @param[in] aPanel The panel representing the note that we're editing. * * @see SongCreationManager::OnModifyNote */ public void HandleEditNote(SC_NoteDisplayPanel aPanel) { // Create a new note dialog. GameObject dialogObj = Instantiate(Resources.Load <GameObject>(NOTE_DIALOG_PATH)); dialogObj.transform.SetParent(transform); // Get the dialog's script and add the listener for when it's finished. SC_NoteDialog dialog = dialogObj.transform.GetChild(0).GetComponent <SC_NoteDialog>(); dialog.LoadNoteIntoDialog(aPanel.GetNote()); mEditIndex = aPanel.GetNoteIndex(); dialog.NoteDialogFinished.AddListener(OnModifyNote); }
/** * @brief Moves a todocnote earlier in the Song. * @param[in] aNotePanel The panel that triggered the event. */ public void HandleMoveNoteRight(SC_NoteDisplayPanel aNotePanel) { // Get the note to move and the note that was previously to the left. Music.CombinedNote noteToMove = aNotePanel.GetNote(); int noteToMoveIndex = aNotePanel.GetNoteIndex(); Music.CombinedNote noteToRight = mSong.GetNote(noteToMoveIndex + 1); // Swap the notes. mSong.ReplaceNote(noteToMove, noteToMoveIndex + 1); mSong.ReplaceNote(noteToRight, noteToMoveIndex); // Reload the song. OnLoadSong(mSong); }