public void UpdateEnsembleList()
    {
        Dropdown ensembleChange = GameObject.Find("EnsembleSelect").GetComponent <Dropdown>();

        ensembleChange.ClearOptions();
        string[] ensembles                 = md.GetEnsembles();
        string   currentEnsemble           = md.GetCurrentEnsemble();
        int      value                     = 0;
        List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();

        for (int i = 0; i < ensembles.Length; i++)
        {
            Dropdown.OptionData item = new Dropdown.OptionData();
            item.text = ensembles[i];
            options.Add(item);
            if (ensembles[i] == currentEnsemble)
            {
                value = i;
            }
        }
        ensembleChange.AddOptions(options);
        ensembleChange.value = value;

        Toggle chiptuneToggle = GameObject.Find("ChiptuneMode").GetComponent <Toggle>();

        chiptuneToggle.isOn = md.GetChiptuneMode();
    }
Esempio n. 2
0
    public void UpdateEnsembleList()
    {
        string[] ensembles       = md.GetEnsembles();
        string   currentEnsemble = md.GetCurrentEnsemble();

        ensembleSelect.ClearOptions();
        int value = 0;
        List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();

        for (int i = 0; i < ensembles.Length; i++)
        {
            Dropdown.OptionData item = new Dropdown.OptionData();
            item.text = ensembles[i];
            options.Add(item);
            if (ensembles[i] == currentEnsemble)
            {
                value = i;
            }
        }
        ensembleSelect.AddOptions(options);
        ensembleSelect.value = value;
    }