本文整理汇总了C#中Answer.setNextConversation方法的典型用法代码示例。如果您正苦于以下问题:C# Answer.setNextConversation方法的具体用法?C# Answer.setNextConversation怎么用?C# Answer.setNextConversation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Answer
的用法示例。
在下文中一共展示了Answer.setNextConversation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createConversation
public static Conversation createConversation(string fileName)
{
string jsonString = readTextFile (/*"Assets/Resources/"*/"Text/" + fileName/* + ".json"*/);
var N = JSON.Parse (jsonString);
string name = N ["name"].Value;
string img = N ["img"].Value;
List<Conversation> conversations = new List<Conversation>();
List<Answer> answers = new List<Answer>();
Conversation start = new Conversation (name, img);
for (int i = 0; i < N["start"].Count; i++) {
Message msg = createMessage(N["start"][i]);
start.addMessage(msg);
}
conversations.Add(start);
for (int i = 0; i < N["ans"].Count; i++) {
Conversation conv = new Conversation(name, img);
Answer ans = new Answer(N["ans"][i]["text"].Value, N["ans"][i]["url"].Value);
Debug.Log(N["ans"][i]["url"].Value);
for (int j = 0; j < N["ans"][i]["nans"].Count; j++) {
Message msg = createMessage(N["ans"][i]["nans"][j]);
conv.addMessage(msg);
}
conversations.Add(conv);
ans.setNextConversation(conv);
answers.Add(ans);
}
for (int i = 0; i < conversations.Count - 1; i++) {
foreach (Answer ans in answers) {
conversations[i].addAnswer(ans);
}
}
return conversations [0];
}