示例#1
0
    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);
    }
示例#2
0
 public IDisposable Show(ICellRW <int> value)
 {
     Show(value);
     return(value.Bind(v => text.text = v.ToString()));
 }