Watson凭证在Unity中的怪异错误 [英] Weird bug with Watson Credentials in Unity

查看:87
本文介绍了Watson凭证在Unity中的怪异错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Watson Assistant实施到Unity中.

I'm trying to implement Watson Assistant into Unity.

当我使用用户名,密码和serviceUrl作为参数创建新的凭据对象时. serviceUrl设置正确,但用户名和密码保持为空.我将相同的代码用于其他服务,但特别是使用此脚本时,我会遇到此错误.

When I create a new Credentials object using the username, password, and serviceUrl as arguments. The serviceUrl is set correctly, but the username and password remain null. I use the same exact code for other services but specifically with this script I get this bug.

//Properties
[SerializeField]
private string _username;
[SerializeField]
private string _password;
[SerializeField]
private string _serviceUrl;

private void CreateService() {
        //Credentials
        Debug.Log(_username);
        Debug.Log(_password);
        Debug.Log(_serviceUrl);

        Credentials credentials = new Credentials(_username, _password, _serviceUrl);

        Debug.Log(credentials.Username);
        Debug.Log(credentials.Password);
        Debug.Log(credentials.Url);

        //Service
        //service = new Assistant(credentials);
}

输出

username
password
serviceUrl

null
null
serviceUrl

我在示例脚本中遇到了同样的问题.

I was getting the same issue with the example script.

推荐答案

在更新Watson SDK之后,我不再在任何脚本中都遇到此错误.仍然不确定确切的问题在旧版本中.这些属性确实是在检查器中设置的,它们似乎可以将值设置得很好,直到将其添加到对象中为止.

After updating the Watson SDK, I no longer get this bug in any of the scripts. Still not sure exactly what the issue was in the old version. The properties were indeed set in the inspector, and they seemed to set the values fine until it was added to the object.

可能不是我使用IAM的事实,但是在更新版本中使用用户名和密码似乎可以正常工作.

It could have been the fact that I wasn't using IAM, however using the username and password in the updated version seems to work fine.

这篇关于Watson凭证在Unity中的怪异错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆