本文整理汇总了C#中Choice.SetText方法的典型用法代码示例。如果您正苦于以下问题:C# Choice.SetText方法的具体用法?C# Choice.SetText怎么用?C# Choice.SetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Choice
的用法示例。
在下文中一共展示了Choice.SetText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Temp
Temp()
{
topic = new List<DialogueNode>();
topic.Add(new DialogueLine(0, "Hello"));
topic.Add(new DialogueLine(1, "Mornin'"));
topic.Add(new DialogueLine(0, "Who stole the cookie from the cookie jar?"));
topic.Add(new DialogueLine(1, "You stole the cookie from the cookie jar.")); // id = 3
topic.Add(new DialogueLine(0, "Who me?"));
topic.Add(new DialogueLine(1, "Yes, you!"));
topic.Add(new DialogueLine(0, "Couldn't be!"));
topic.Add(new DialogueLine(1, "Then who?"));
DialogueChoice dc = new DialogueChoice();
Choice c = new Choice();
c.SetText("No idea.");
c.AddOutcome(new OutcomeJump(3));
dc.AddChoice(c);
c = new Choice();
c.AddOutcome(new OutcomeMood(0, -10));
c.SetText("I lied, it was me actually."); // Choices CAN have no outcome, dialogue continues from next line
dc.AddChoice(c);
c = new Choice();
c.AddOutcome(new OutcomeEnd());
c.SetText("*Run Away*");
dc.AddChoice(c);
topic.Add(dc);
topic.Add(new DialogueLine(1, "As expected, I'll be a master detective in no time."));
topic.Add(new DialogueLine(0, "A master without cookies that is."));
}
示例2: ProcessChoiceOption
private Choice ProcessChoiceOption()
{
Choice c = new Choice();
string line;
do
{
line = GetValidLine();
if(line != null)
{
if(line[0] == '}')
break;
else
{
string[] elements = line.Split('=');
switch(elements[0].ToLower())
{
case "text":
c.SetText(elements[1]);
break;
case "outcome":
ChoiceOutcome co = ProcessChoiceOutcome(elements[1]);
if(co != null)
c.AddOutcome(co);
break;
}
}
}
} while(line!=null);
return c;
}