我试图运行在IBM的统一沃森会话业务和following here, code snippetIBM沃森交谈服务错误:无法从“方法组”转换为“conversation.onMessage”
private Conversation m_Conversation = new Conversation();
private string m_WrokspaceID = "xyz";
private string m_input = "help";
// Use this for initialization
void Start() {
Debug.Log("user : " + m_input);
m_Conversation.Message(OnMessage, m_WrokspaceID, m_input);
}
void OnMessage(MessageResponse resp, string customData) {
foreach (Intent mi in resp.intents)
{
Debug.Log("intent : " + mi.intent + ", confidence :" + mi.confidence);
}
Debug.Log("response :" + resp.output.text);
}
但我得到这个错误
cannot convert from 'method group' to 'conversation.onMessage'
我做错了什么?我从watson官方github回购中得到的代码片段。
在哪一行发生此错误?我猜'm_Converstion.Message(OnMessage ...''m_Conversation.Message'的签名是什么?它作为第一个参数而不是该方法的期望是什么? –
@RenéVogt是同一行,它期望对象 –