public BuildCallback(string lbl, List <T> or, ListExt.Mapper <T, string> mapper, Action <SelectState <T> > os) { Label = lbl; Origins = or; Mapper = mapper; OnSelected = os; }
public bool Build(string lbl, T value, List <T> origins, ListExt.Mapper <T, string> mapper, Action <SelectState <T> > onSelected = null, AddAction addAction = null, DeleteAction delAction = null) { return(Build(new BuildCallback( lbl, value, origins, mapper, onSelected, addAction, delAction ))); }
public bool Build(string lbl, T value, List <T> origins, ListExt.Mapper <T, string> mapper, Action <SelectState <T> > onSelected = null) { int cur = origins.IndexOf(value); int selected = EditorGUILayout.Popup(lbl, cur, origins.Map(x => mapper(x)).ToArray()); if (cur != selected) { onSelected.Invoke(new SelectState <T>(selected, origins[selected])); cur = selected; } return(cur >= 0); }
public BuildCallback(string lbl, T v, List <T> or, ListExt.Mapper <T, string> mapper, Action <SelectState <T> > os) : this(lbl, or, mapper, os) { Value = v; }
public BuildCallback(string lbl, List <T> or, ListExt.Mapper <T, string> mapper, Action <SelectState <T> > os, DeleteAction delAction) : this(lbl, or, mapper, os) { DelAction = delAction; }
public BuildCallback(string lbl, T v, List <T> or, ListExt.Mapper <T, string> mapper, Action <SelectState <T> > os, AddAction addAction, DeleteAction delAction, Action <T> prefix, Action <T> suffix) : this(lbl, v, or, mapper, os, addAction, delAction, prefix) { Suffix = suffix; }
public BuildCallback(string lbl, T v, List <T> or, ListExt.Mapper <T, string> mapper, Action <SelectState <T> > os, AddAction addAction, DeleteAction delAction, MoveAction moveAction) : this(lbl, v, or, mapper, os, addAction, delAction) { MoveAction = moveAction; }