Get text from Input field in Unity3D with C#
来源:互联网 发布:南京旅游攻略 知乎 编辑:程序博客网 时间:2024/04/28 20:18
Attach below monobehaviour script to your InputField gameObject:
public class test : MonoBehaviour { void Start () { var input = gameObject.GetComponent<InputField>(); var se= new InputField.SubmitEvent(); se.AddListener(SubmitName); input.onEndEdit = se; //or simply use the line below, //input.onEndEdit.AddListener(SubmitName); // This also works } private void SubmitName(string arg0) { Debug.Log(arg0); }}
See also below animation:
0 0
- Get text from Input field in Unity3D with C#
- Reading Text from Text Field
- How can I move text cursor in a text input field?[摘]
- How to get the password text in a text with password property from another process using C++ - 用C++如何从不同进程获取密码框文本
- Field.Text AND Field.Keyword in Lucene
- Fill input field in IE
- open text file with notpad from c# code
- Get number from string with regular expression in java
- How to get groups, users from Active Directory with C#
- Reading device input directly from/to /dev/input/eventX in Ubuntu with C
- Get Selected Radio button’s Text in C# windows app
- Get URL from the text
- C# - Get HttpWebResponse Text
- C# unity3D get post
- Exception in thread "main" java.lang.IllegalStateException: Cannot get a text value from a numeric c
- Get field class in annotations processor
- yii input form text field auto covert to UPPER CASE
- set yii input form text field to read only.
- 你好Unity3D#Unity获取游戏对象详解
- C/C++声明类型typedef
- linux 命令工具 之 find
- “融合”理念
- 茶杯大小的狗狗,看一眼整个人都酥了!
- Get text from Input field in Unity3D with C#
- 拖拽中怎么修复bug
- 全屏下保持状态栏存在
- Matlab批量修改文件名
- 工具依赖症
- HPU1012: QAQ的区间统计【找规律】
- InputField.onValueChanged
- JavaScript趣题:排列组合实战
- yarn - 一个可能取代npm的新型包管理器[Facebook出品,附带中文使用教程]