当前位置: 首页>>代码示例>>C#>>正文


C# Conversation.GetDialogueEntry方法代码示例

本文整理汇总了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);
                        }
                    }
                }
            }
        }
开发者ID:farreltr,项目名称:OneLastSunset,代码行数:31,代码来源:DialogueEditorWindowDatabaseSection.cs

示例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));
             }
         }
     }
 }
开发者ID:farreltr,项目名称:OneLastSunset,代码行数:18,代码来源:AuroraConverterWindow.cs


注:本文中的Conversation.GetDialogueEntry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。