Autocomplete
Note
Options
Input Field
InputFieldInput field.
Target List View
TListViewListView to display available values.
Display List View
TListViewSelected value will be added to this ListView.
Allow Duplicate
boolTargetListView can have duplicate items if this option is enabled.Data type must implementIEquatable<T>interface for this option to work correctly.Data Source
List<TValue>List of the all values.
Filter
AutocompleteFilterFilter settings.
StartswithValue should starts with the specified input.
ContainsValue should contains with the specified input.
Case Sensitive
boolIs filter case sensitive?
Delimiter Chars
char[]Delimiter chars to split input to the words.
Input Type
AutocompleteInputFilter with the current word or the whole input.
WordAllInput
Result
AutocompleteResultWhat to do with input after value selected.
AppendReplace
Min Length
intMinimal length of the input to start search.
Search Delay
floatThe delay in seconds between when a keystroke occurs and when a search is performed.
Unscaled Time
boolDelay with unscaled time.
ResetListViewSelection
boolDeselect selected items in the DisplayListView.
AllowCancelOnDeselect
Func<BaseEventData, AutocompleteCustom<TValue, TListViewComponent, TListView>, bool>Allow to cancel DisplayListView close on deselect event.
Events
OnOptionSelected
UnityEventOnOptionSelectedItem
UnityEvent<TValue>OnItemNotFound
UnityEvent<string>OnCancelInput
UnityEventOnSearchCompleted
UnityEventOnShowOptions
UnityEvent<AutocompleteCustom<TValue, TListViewComponent, TListView>>OnHideOptions
UnityEvent<AutocompleteCustom<TValue, TListViewComponent, TListView>>
namespace UIWidgets.Examples
{
using UIWidgets;
using UnityEngine;
public class AutocompleteIconsText: MonoBehaviour
{
[SerializeField]
public AutocompleteIcons Autocomplete;
[SerializeField]
ListViewIconsItemDescription item;
void Start()
{
Autocomplete.OnOptionSelectedItem.AddListener(SetItem);
}
void OnDestroy()
{
Autocomplete.OnOptionSelectedItem.RemoveListener(SetItem);
}
void SetItem(ListViewIconsItemDescription newItem)
{
item = newItem;
}
}
}