public void OnMenuChanged(int option) { if (cur != null) { cur.Deactivate(); } if (option < groups.Count) { cur = groups[option]; cur.Activate(); } }
void Start() { if (groups.Count > 0) { cur = groups.First(); cur.Activate(); } menu.AddOptions(groups.Select(group => { var option = new Dropdown.OptionData(); option.text = group.name; return(option); }).ToList()); }