0

,我在简单登录时遇到问题(从这里https://github.com/bdodroid/SimpleScripts-LoginSystem)一切正常,但是当我想登录时它说:

ArgumentNullException:参数不能为空。参数名:s System.Int32.Parse(System.String s)(在/Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Int32.cs:629) Login+c__Iterator13.MoveNext()(在 Assets/xxx/Demo/Login.cs:118)

我的 Login.cs 中的第 118 行是:

    userID = int.Parse(parsedData[1]["ID"]);

请帮助我,我的代码与这里相同,因此您可以查看 https://github.com/bdodroid/SimpleScripts-LoginSystem

谢谢你!

4

1 回答 1

2

Login.cs 中的第 119 行说:

responseText.GetComponent().text = "已连接";

和你说的错误null exception。这意味着responseText没有Text组件或responseText从未在编辑器中分配游戏对象。responseText被声明为:

public GameObject responseText;

这意味着它将在 Unity 编辑器中序列化,您必须自己分配它。只需将您的 ResponseText 对象拖到编辑器中的字段。

于 2017-04-11T17:04:31.877 回答