博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
unity, ugui input field
阅读量:6889 次
发布时间:2019-06-27

本文共 489 字,大约阅读时间需要 1 分钟。

ugui Input Field,获取输入的字符串。

错误方法:

string content=inputField.FindChild("Text").text;

这样得到的是输入框中当前盛下的字符串,如果输入框面积小于输入内容,则此时得到的只是输入内容中的一段。

正确方法:

string content=inputField.getComponent<InputField>().text

这样得到的才是完整的输入内容。

说明见unity文档:

  • To obtains the text of the Input Field, use the text property on the InputField component itself, not the text property of the Text component that displays the text. The text property of the Text component may be cropped or may consist of asterisks for passwords.

转载地址:http://igtbl.baihongyu.com/

你可能感兴趣的文章
python爬虫爬取赶集网数据
查看>>
微信公众平台开发(系列教程)
查看>>
CentOS中配置Kafka集群
查看>>
Android IOS WebRTC 音视频开发总结(六六)-- 三个角度分析美女视频直播这个行业...
查看>>
ExpandableListView视图树简单应用
查看>>
popwindow
查看>>
多线程 打字练习
查看>>
[BSGS]
查看>>
day19-2 生成器,递归函数
查看>>
未能加载文件或程序集“Enyim.Caching”或它的某一个依赖项。未能验证强名称签名...
查看>>
设计模式——面向对象设计原则
查看>>
mysql安装
查看>>
301、302跳转与200状态码
查看>>
小波变化库——Pywalvets学习笔记
查看>>
y - 1,一个 缝隙,
查看>>
2维矩阵前缀和技巧题目
查看>>
关于git的一些操作
查看>>
[原]RobotFrameWork(四)变量运算与Evaluate
查看>>
心态决定命运_no excuses, suck it up, obey your teacher
查看>>
【HDOJ】2371 Decode the Strings
查看>>