ChipsImportantEnableSaintsEditorand use a UI Toolkit inspector before using
Display an array/list as a row of removable chips. Support search for a value. Drag an chip to reorder it.
Similar to Dropdown: string callback that returns a Dropdown<T> or an enumerable (support async call of Task, UniTask, or IEnumerator), omit the callback for an enum or a type with static values.
Arguments
string callback=null: callback used to obtain the available values.EUnique unique=EUnique.None: When using on a list/array, a duplicated option can be removed ifEnique.Remove, or disabled ifEUnique.Disable. No use for non-list/array.bool slashAsSub = true: should it tread/as path seperator in dropdown? This is helpful if you have SaintsField enabled, and hasenumdefined withInspectorName, but the/does not mean for grouping
using SaintsField; [Serializable] public enum Equipment { Special, [InspectorName("Weapon/Sword")] Sword, [InspectorName("Weapon/Bow")] Bow, [InspectorName("Armor/Shield")] Shield, } [Chips] public Equipment[] normalList; // duplicated options are disabled [Chips(EUnique.Disable)] public Equipment[] disableList; // duplicated options are removed [Chips(EUnique.Remove)] public Equipment[] removeList; [Chips(nameof(GetTags), slashAsSub = false)] // callback public List<string> tags; private IEnumerable<string> GetTags() => new[] { "Player", "Enemy/Boss", "Environment", }; [Chips(nameof(GetEnvAsync))] // async public List<int> envLayer; private IEnumerator GetEnvAsync() // you can also use Waitable<Dropdown<int>>/Task<Dropdown<int>> { yield return new WaitForSeconds(2); yield return new Dropdown<int>() { { "Basic", 1 }, { "Advanced/MiniBoss", 2 }, { "Advanced/Boss", 2 }, { "Final/Boss", 3 }, }; }