Wiki > AutoComplete TextField

AutoCompleteAttribute class

Attribute class that can be used to add AutoComplete logic to a string field without the need of a custom editor.

Namespace: RotaryHeart.Lib.AutoComplete
Package: AutoComplete TextField


public class AutoCompleteAttribute : PropertyAttribute


Accessibility Level Name Description
public AutoCompleteAttribute(string[]) Adds the array of string to be used for the dropdown.


Accessibility Level Type Name Description
public string[] Entries Array of string to be used by the dropdown.


Here's a quick example of how to use the attribute.

[AutoComplete(new string[] { "Entry 1", "Entry 2", "entry 3" })]
public string textField;

Note that we are using if UNITY_EDITOR since the array of entries is not needed for a built game.