本文整理汇总了C#中Statement.SetText方法的典型用法代码示例。如果您正苦于以下问题:C# Statement.SetText方法的具体用法?C# Statement.SetText怎么用?C# Statement.SetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statement
的用法示例。
在下文中一共展示了Statement.SetText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadStatements
public Dictionary<int, Statement> LoadStatements(string nameIn)
{
//Get statment id in
//string nameIn = "Smith";
//Debug.Log("SET STATE" + nameIn.ToString());
Statement statement;
Dictionary<int,Statement> statements = new Dictionary<int, Statement>();
// Statement[] statement_array = new Statement[10];
int index = -1;
bool found = false;
xml = (TextAsset)Resources.Load(statement_xml);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml.text);
//Debug.Log("REACHED");
XmlNodeList statement_list = xmlDoc.GetElementsByTagName("Stage");
foreach(XmlNode dialog_fragment in statement_list){
XmlNodeList xnl = dialog_fragment.ChildNodes;
statement = new Statement();
foreach(XmlNode xn in xnl ){
//ADD NPC ID TO DATABASE
if(xn.Name == "Owner_Name" && xn.InnerText != nameIn.ToString()){
found = false;
}
if(xn.Name == "Owner_Name" && xn.InnerText == nameIn.ToString()){
found = true;
index++;
//Debug.Log("Response_id : " + xn.InnerText);
statement.SetOwnerName(xn.InnerText);
}
if(xn.Name == "Statement_ID" && found){
// Debug.Log("Symbol: " + xn.InnerText);
statement.SetStatementId(xn.InnerText);
}
if(xn.Name == "Text" && found){
//Debug.Log("TEXT: " + xn.InnerText);
statement.SetText(xn.InnerText);
}
if(xn.Name == "AudioFile" && found){
// Debug.Log("Audio File: " + xn.InnerText);
statement.SetAudioFile(xn.InnerText);
}
if(xn.Name == "Response_ID" && found){
//Debug.Log("Next Statement: " + xn.InnerText);
statement.SetResponseId(xn.InnerText);
}
}
//Add to response array
if(found)
//Before statement is saved to array, load responses
statement.SetResponses();
//Debug.Log("DICT BROKE " + statement.GetResponseId().ToString());
if (statement.GetStatementId() != 0){
statements.Add(statement.GetStatementId(), statement);}
//statement_array[index] = statement;
}
/*for(int i = 0; i < 4; i++){
Debug.Log("Array test: " + response_array[i].getText());
}*/
//Return array
return statements;
}