Unity 获取汉字笔画数
string chineseChar = "破"; byte[] utf8Bytes = Encoding.UTF8.GetBytes(chineseChar); string urlEncoded = string.Join("%", utf8Bytes.Select(b => b.ToString("X2"))); var str = $"https://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=%{urlEncoded}"; var web = UnityWebRequest.Get(str); web.SendWebRequest(); while (!web.isDone) { } if (web.isDone) { }
最后获取到web的text,找到【kTotalStrokes】字段 下面的数字就是笔画数,将text自行处理就好

浙公网安备 33010602011771号