发布于 2021-07-08 06:48:38
gameObject不包含名为“text”的字段。要访问的是InputField类型组件的字段“text”。
因此,在您的代码中,您应该按以下方式调用它:
Debug.Log(UsernameInput.GetComponent<InputField>().text);
我允许您使用这里超链接到关于Unity的文档,其中讨论了它们是什么。
https://stackoverflow.com/questions/68296264
复制相似问题