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