本文整理汇总了C#中Conversation.GetDialogueEntry方法的典型用法代码示例。如果您正苦于以下问题:C# Conversation.GetDialogueEntry方法的具体用法?C# Conversation.GetDialogueEntry怎么用?C# Conversation.GetDialogueEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conversation
的用法示例。
在下文中一共展示了Conversation.GetDialogueEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignConnectors
private void AssignConnectors(DialogueEntry entry, Conversation conversation, HashSet<string> alreadyConnected, HashSet<int> entriesVisited, int level)
{
// Sanity check to prevent infinite recursion:
if (level > 10000) return;
// Set non-connectors:
foreach (Link link in entry.outgoingLinks) {
if (link.originConversationID == link.destinationConversationID) {
string destination = string.Format("{0}.{1}", link.destinationConversationID, link.destinationDialogueID);
if (alreadyConnected.Contains(destination)) {
link.isConnector = true;
} else {
link.isConnector = false;
alreadyConnected.Add(destination);
}
}
}
// Then process each child:
foreach (Link link in entry.outgoingLinks) {
if (link.originConversationID == link.destinationConversationID) {
if (!entriesVisited.Contains(link.destinationDialogueID)) {
entriesVisited.Add(link.destinationDialogueID);
var childEntry = conversation.GetDialogueEntry(link.destinationDialogueID);
if (childEntry != null) {
AssignConnectors(childEntry, conversation, alreadyConnected, entriesVisited, level + 1);
}
}
}
}
}
示例2: MarkLinkCondition
private void MarkLinkCondition(Struct structEntry, Conversation conversation, int destinationDialogueID, string dlgName)
{
string conditionScript = structEntry.Active;
bool hasConditionScript = !string.IsNullOrEmpty(conditionScript);
if (hasConditionScript) {
DialogueEntry dialogueEntry = conversation.GetDialogueEntry(destinationDialogueID);
if (dialogueEntry != null) {
if (prefs.ScriptHandlingType == ScriptHandlingType.CustomLuaFunction) {
dialogueEntry.conditionsString = string.Format("NWScript(\"{0}\")", conditionScript);
} else {
dialogueEntry.conditionsString = string.Format("{0}{1}", "true --", conditionScript);
}
if (reportQuestsAndScriptsFlag) {
Debug.LogWarning(string.Format("{0}: '{1}' entry {2} {3} active condition: {4} -> {5}", DialogueDebug.Prefix, dlgName, structEntry.id, GetTextSnippet(dialogueEntry), conditionScript, dialogueEntry.conditionsString));
}
}
}
}