public DebugLayout Selector(FieldPresentSettings name, IList <string> options, ICellRW <string> value , DebugLayoutOptions opts = default(DebugLayoutOptions)) { Dropdown selector = NamedElementOrLayouted <Dropdown>(name, factory.dropdownPrefab, opts).GetComponentInChildren <Dropdown>(); selector.options = options.Select(elemName => new Dropdown.OptionData(elemName)).ToList(); value.Bind(v => selector.value = options.IndexOf(v)); selector.onValueChanged.AddListener(new UnityAction <int>(i => { value.value = options[i]; })); return(this); }
public IDisposable Show(ICellRW <int> value) { Show(value); return(value.Bind(v => text.text = v.ToString())); }