用gui 做输入框的时候,遇到了不能编辑的问题
去google了guilayout.textfield not editable
找到了答案
name = GUILayout.TextField(name);
这行代码里,不要把name在ongui里面声明,要在函数外声明
附答案:Store the input variables as a member of your class/script, not the method. Each frame you reset it back to an empty string wiping out what the user was trying to input.