Exemplo n.º 1
0
    private void DisplayNote(Sentence sentence, Note note)
    {
        UiNote uiNote = Instantiate(uiNotePrefab);

        uiNote.transform.SetParent(transform);
        uiNote.Note     = note;
        uiNote.isGolden = note.IsGolden;

        Text uiNoteText = uiNote.GetComponentInChildren <Text>();

        uiNoteText.text = note.Text + " (" + MidiUtils.GetAbsoluteName(note.MidiNote) + ")";

        RectTransform uiNoteRectTransform = uiNote.GetComponent <RectTransform>();

        PositionUiNote(uiNoteRectTransform, note.MidiNote, note.StartBeat, note.EndBeat);
    }
Exemplo n.º 2
0
    private void CreateUiNote(Note note)
    {
        if (note.StartBeat == note.EndBeat)
        {
            return;
        }

        UiNote uiNote = Instantiate(uiNotePrefab, uiNotesContainer);

        uiNote.Init(note, uiEffectsContainer);
        if (micProfile != null)
        {
            uiNote.SetColorOfMicProfile(micProfile);
        }

        Text   uiNoteText = uiNote.GetComponentInChildren <Text>();
        string pitchName  = MidiUtils.GetAbsoluteName(note.MidiNote);

        if (showLyricsOfNotes && showPitchOfNotes)
        {
            uiNoteText.text = note.Text + " (" + pitchName + ")";
        }
        else if (showLyricsOfNotes)
        {
            uiNoteText.text = note.Text;
        }
        else if (showPitchOfNotes)
        {
            uiNoteText.text = pitchName;
        }
        else
        {
            uiNoteText.text = "";
        }

        RectTransform uiNoteRectTransform = uiNote.GetComponent <RectTransform>();

        PositionUiNote(uiNoteRectTransform, note.MidiNote, note.StartBeat, note.EndBeat);
    }