Пример #1
0
    private void AddSection(Songs.SongType songType)
    {
        var section = Instantiate(SectionPrefab, ScrollContents);

        section.name = songType.ToString();
        var liSection = section.GetComponent <ListItemSection>();

        liSection.Title.text = songType.ToString();

        _allSections.Add(songType, liSection);
    }
Пример #2
0
    private void AddSong(Songs.SongType songType, Song song)
    {
        var songButton = Instantiate(ButtonPrefab, ScrollContents);
        var li         = songButton.GetComponent <ListItemSong>();

        songButton.name = song.Title;
        li.Title.text   = song.Title;
        li.Melody.text  = song.Melody;
        li.Song         = song;
        li.Manager      = this;
        li.Song.Type    = songType;

        _allListItems.Add(li);
    }
Пример #3
0
    private void AddSongsByType(Songs.SongType songType)
    {
        AddSection(songType);

        switch (songType)
        {
        case Songs.SongType.Ekivoka:
            foreach (var song in Songs.GetEkivokaSongs())
            {
                AddSong(songType, song);
            }
            break;

        default:
            foreach (var song in Songs.GetAllSongs(songType))
            {
                AddSong(songType, song);
            }
            break;
        }
    }