本文整理汇总了C#中Response.SetText方法的典型用法代码示例。如果您正苦于以下问题:C# Response.SetText方法的具体用法?C# Response.SetText怎么用?C# Response.SetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Response
的用法示例。
在下文中一共展示了Response.SetText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadResponses
public Response[] LoadResponses(int idIn)
{
//Get statment id in
//int idIn = 1;
Response[] response_array = new Response[4];
response_array[0] = new Response();
response_array[1] = new Response();
response_array[2] = new Response();
response_array[3] = new Response();
int index = -1;
bool found = false;
xml = (TextAsset)Resources.Load(response_xml);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml.text);
//Debug.Log("REACHED");
XmlNodeList choice_list = xmlDoc.GetElementsByTagName("choices");
foreach(XmlNode dialog_fragment in choice_list){
XmlNodeList xnl = dialog_fragment.ChildNodes;
response = new Response();
foreach(XmlNode xn in xnl ){
if(xn.Name == "Response_ID" && xn.InnerText != idIn.ToString()){
found = false;
}
if(xn.Name == "Response_ID" && xn.InnerText == idIn.ToString()){
found = true;
index++;
//Debug.Log("Response_id : " + xn.InnerText);
response.SetResponseId(xn.InnerText);
}
if(xn.Name == "Text" && found){
//Debug.Log("TEXT: " + xn.InnerText);
response.SetText(xn.InnerText);
}
if(xn.Name == "AudioFile" && found){
// Debug.Log("Audio File: " + xn.InnerText);
response.SetAudioFile(xn.InnerText);
}
if(xn.Name == "Symbol" && found){
// Debug.Log("Symbol: " + xn.InnerText);
response.SetSymbol(xn.InnerText);
}
if(xn.Name == "NextStatement" && found){
//Debug.Log("Next Statement: " + xn.InnerText);
response.SetNextStatement(xn.InnerText);
}
}
//Add to response array
if(found)
response_array[index] = response;
}
/*for(int i = 0; i < 4; i++){
Debug.Log("Array test: " + response_array[i].getText());
}*/
//Return array
return response_array;
}