This entry is from Tuesday September 3, 2024. The price of the asset may have changed since then. Please visit our homepage for recent offers and sales. Official and private Unity Asset Store™ sales usually last about 14 days.
Overview
Main Usage
Chinese fonts are needed. My recommendation is Noto, which is free.
[Optional] If you want to generate a new Chinese dictionary:
A Chinese word list under the Python directory, named wordfreq.txt, formatted as [Chinese word]\t[frequency].
pip install pinyin and run cn_parser.py.
Open Unity Editor, click Tools > Construct Py Prefab to open the generator, input the Chinese word list and hash txt path, and click generate to get the prefab.
For example, if the list you generated is Assets\WPinyin\Dictionary\PinyinWords-words.json, then input Assets\WPinyin\Dictionary\PinyinWords.
You can also select how many words you need in the list. The words will be selected based on frequency, with high-frequency words having higher priorities.
Open the KeyBoard prefab, drag the word prefab you just generated onto the pyCode field.
[Optional] If you want to generate a new English word dictionary:
An English word list under the Python directory, named en_freq.txt, with a title in the first line, formatted as [Word]\t[PoS]\t[Freq].
Run en_parser.py.
Code Usage
To set the target input field: KeyBoardManager.SetTargetField(TMP_InputField target).
To refresh and add input field focus listener: KeyBoardManager.GetAllInputFields().