/// <summary>
 /// Search the portraitFolder in the Asset Database for all actors' portrait images.
 /// </summary>
 /// <param name="database">Dialogue database.</param>
 /// <param name="portraitFolder">Portrait folder in Assets, typically provided from ConverterPrefs.PortraitFolder.</param>
 public static void FindPortraitTexturesInAssetDatabase(ArticyData articyData, string portraitFolder, DialogueDatabase database)
 {
     if (database == null)
     {
         return;
     }
     foreach (var actor in database.actors)
     {
         FindPortraitTextureInAssetDatabase(articyData, portraitFolder, actor);
     }
 }
        /// <summary>
        /// Draws the Slots handling checkbox.
        /// </summary>
        private void DrawSlotsPopup()
        {
            var newValue = (ConverterPrefs.ConvertSlotsModes)EditorGUILayout.EnumPopup(new GUIContent("Slots as ", "Specify how to import slots."), prefs.ConvertSlotsAs, GUILayout.Width(300));

            if (newValue != prefs.ConvertSlotsAs)
            {
                prefs.ConvertSlotsAs = newValue;
                articyData           = null;
                ConverterPrefsTools.Save(prefs);
            }
        }
 private void MassSelectVariables(bool value)
 {
     foreach (ArticyData.VariableSet variableSet in articyData.variableSets.Values)
     {
         foreach (ArticyData.Variable variable in variableSet.variables)
         {
             string            id = ArticyData.FullVariableName(variableSet, variable);
             ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(id);
             conversionSetting.Include = value;
         }
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Convert the ArticyData, using the preferences in Prefs, into a dialogue database.
 /// </summary>
 /// <param name='articyData'>
 /// Articy data.
 /// </param>
 /// <param name='prefs'>
 /// Prefs.
 /// </param>
 /// <param name='database'>
 /// Dialogue database.
 /// </param>
 public void Convert(ArticyData articyData, ConverterPrefs prefs, DialogueDatabase database)
 {
     if (articyData != null)
     {
         Setup(articyData, prefs, database);
         ConvertProjectAttributes();
         ConvertEntities();
         ConvertLocations();
         ConvertFlowFragments();
         ConvertVariables();
         ConvertDialogues();
     }
 }
        private void BuildArticyVarNameList()
        {
            var list = new List <string>();

            foreach (ArticyData.VariableSet variableSet in articyData.variableSets.Values)
            {
                foreach (ArticyData.Variable variable in variableSet.variables)
                {
                    list.Add(ArticyData.FullVariableName(variableSet, variable));
                }
            }
            articyVarNameList = list.ToArray();
        }
Exemplo n.º 6
0
 /// <summary>
 /// Convert the ArticyData, using the preferences in Prefs, into a dialogue database.
 /// </summary>
 /// <param name='articyData'>
 /// Articy data.
 /// </param>
 /// <param name='prefs'>
 /// Prefs.
 /// </param>
 /// <param name='database'>
 /// Dialogue database.
 /// </param>
 public void Convert(ArticyData articyData, ConverterPrefs prefs, DialogueDatabase database)
 {
     if (articyData != null) {
         Setup(articyData, prefs, database);
         ConvertProjectAttributes();
         ConvertEntities();
         ConvertLocations();
         if (prefs.FlowFragmentMode == ConverterPrefs.FlowFragmentModes.Quests) {
             ConvertFlowFragmentsToQuests();
         }
         ConvertVariables();
         ConvertDialogues();
     }
 }
Exemplo n.º 7
0
 private void ReviewArticyProject()
 {
     articyData = ArticySchemaTools.LoadArticyDataFromXmlFile(prefs.ProjectFilename, prefs.Encoding);
     if (articyData != null)
     {
         projectTitle   = articyData.ProjectTitle;
         projectVersion = articyData.ProjectVersion;
         projectAuthor  = articyData.ProjectAuthor;
         Debug.Log(string.Format("{0}: Loaded {1}", DialogueDebug.Prefix, prefs.ProjectFilename));
     }
     else
     {
         Debug.LogError(string.Format("{0}: Failed to load {1}", DialogueDebug.Prefix, prefs.ProjectFilename));
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Sets up the conversion process.
 /// </summary>
 /// <param name='articyData'>
 /// Articy data.
 /// </param>
 /// <param name='prefs'>
 /// Prefs.
 /// </param>
 /// <param name='database'>
 /// Dialogue database.
 /// </param>
 private void Setup(ArticyData articyData, ConverterPrefs prefs, DialogueDatabase database)
 {
     this.articyData        = articyData;
     this.prefs             = prefs;
     this.database          = database;
     database.actors        = new List <Actor>();
     database.items         = new List <Item>();
     database.locations     = new List <Location>();
     database.variables     = new List <Variable>();
     database.conversations = new List <Conversation>();
     conversationID         = 0;
     actorID    = 0;
     itemID     = 0;
     locationID = 0;
     fullVariableNames.Clear();
     template = Template.FromEditorPrefs();
 }
 /// <summary>
 /// Draws the articy:draft Project filename field.
 /// </summary>
 private void DrawProjectFilenameField()
 {
     EditorGUI.BeginChangeCheck();
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.TextField(new GUIContent("articy:draft Project", "The XML file that you exported from articy:draft."), prefs.ProjectFilename);
     if (GUILayout.Button("...", EditorStyles.miniButtonRight, GUILayout.Width(22)))
     {
         prefs.ProjectFilename      = EditorUtility.OpenFilePanel("Select articy:draft Project", EditorWindowTools.GetDirectoryName(prefs.ProjectFilename), "xml");
         GUIUtility.keyboardControl = 0;
     }
     EditorGUILayout.EndHorizontal();
     if (EditorGUI.EndChangeCheck())
     {
         ConverterPrefsTools.Save(prefs);
         articyData = null;
     }
 }
Exemplo n.º 10
0
        /// <summary>
        /// Converts articy variable sets and variables into Dialogue System variables.
        /// </summary>
        private void ConvertVariables()
        {
            int variableID = 0;

            foreach (ArticyData.VariableSet articyVariableSet in articyData.variableSets.Values)
            {
                foreach (ArticyData.Variable articyVariable in articyVariableSet.variables)
                {
                    string fullName = ArticyData.FullVariableName(articyVariableSet, articyVariable);
                    fullVariableNames.Add(fullName);
                    if (prefs.ConversionSettings.GetConversionSetting(fullName).Include)
                    {
                        variableID++;
                        Variable variable = template.CreateVariable(variableID, fullName, articyVariable.defaultValue);
                        variable.Type = (articyVariable.dataType == ArticyData.VariableDataType.Boolean)
                                                        ? FieldType.Boolean
                                                                : (articyVariable.dataType == ArticyData.VariableDataType.Integer)
                                                                ? FieldType.Number
                                                                : FieldType.Text;
                        database.variables.Add(variable);
                    }
                }
            }
        }
Exemplo n.º 11
0
 private void DrawArticyVariables()
 {
     articyVariablesFoldout = EditorGUILayout.Foldout(articyVariablesFoldout, "Variables");
     if (articyVariablesFoldout)
     {
         StartIndentedSection();
         foreach (ArticyData.VariableSet variableSet in articyData.variableSets.Values)
         {
             foreach (ArticyData.Variable variable in variableSet.variables)
             {
                 EditorGUILayout.BeginHorizontal();
                 string            id = ArticyData.FullVariableName(variableSet, variable);
                 ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(id);
                 conversionSetting.Include = EditorGUILayout.Toggle(conversionSetting.Include, GUILayout.Width(ToggleWidth));
                 EditorGUI.BeginDisabledGroup(true);
                 EditorGUILayout.TextField(id);
                 EditorGUILayout.TextField(variable.technicalName);
                 EditorGUI.EndDisabledGroup();
                 EditorGUILayout.EndHorizontal();
             }
         }
         EndIndentedSection();
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// Processes a node in the hierarchy. If it's a dialogue, convert it (and its child nodes)
 /// into a Dialogue System conversation. Otherwise keep processing the children.
 /// </summary>
 /// <param name='node'>
 /// Node to process.
 /// </param>
 private void ProcessNode(ArticyData.Node node)
 {
     // Push flow fragment names onto stack as we descend into them:
     if (node.type == ArticyData.NodeType.FlowFragment) {
         var flowFragment = LookupFlowFragment(node.id);
         flowStack.Add(flowFragment.displayName.DefaultText);
     }
     // Process all child nodes, looking for dialogues:
     foreach (ArticyData.Node childNode in node.nodes) {
         if (childNode.type == ArticyData.NodeType.Dialogue) {
             ConvertDialogue(childNode);
         } else {
             ProcessNode(childNode);
         }
     }
     // Pop flow fragment names as we finish with them:
     if (node.type == ArticyData.NodeType.FlowFragment) {
         flowStack.RemoveAt(flowStack.Count - 1);
     }
 }
Exemplo n.º 13
0
 private void SetFeatureFields(List<Field> fields, ArticyData.Features features)
 {
     foreach (ArticyData.Feature feature in features.features) {
         foreach (ArticyData.Property property in feature.properties) {
             foreach (Field field in property.fields) {
                 if (!string.IsNullOrEmpty(field.title)) {
                     var existingField = Field.Lookup(fields, field.title);
                     if (existingField != null) {
                         existingField.value = field.value;
                     } else {
                         fields.Add(new Field(field.title, field.value, field.type));
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 14
0
 private bool HasIsPlayerField(ArticyData.Features features)
 {
     foreach (ArticyData.Feature feature in features.features) {
         foreach (ArticyData.Property property in feature.properties) {
             foreach (Field field in property.fields) {
                 if (string.Equals(field.title, "IsPlayer")) return true;
             }
         }
     }
     return false;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Converts a connection into an outgoing link in a conversation's dialogue entry.
 /// Condition nodes create two dialogue entries with the same articy ID (one for true,
 /// one for false). In this case, the correct one is connected to the destination
 /// based on the the "destination articy id" field recorded in the origin entry.
 /// </summary>
 /// <param name='conversation'>
 /// Conversation.
 /// </param>
 /// <param name='connection'>
 /// Connection.
 /// </param>
 private void ConvertConnection(Conversation conversation, ArticyData.Connection connection)
 {
     if (connection != null) {
         foreach (DialogueEntry origin in conversation.dialogueEntries) {
             if (string.Equals(Field.LookupValue(origin.fields, ArticyIdFieldTitle), connection.source.idRef)) {
                 foreach (DialogueEntry destination in conversation.dialogueEntries) {
                     if (string.Equals(Field.LookupValue(destination.fields, ArticyIdFieldTitle), connection.target.idRef)) {
                         bool isValidToLink = true;
                         if (Field.FieldExists(origin.fields, DestinationArticyIdFieldTitle)) {
                             string requiredDestinationArticyId = Field.LookupValue(origin.fields, DestinationArticyIdFieldTitle);
                             string destinationArticyId = Field.LookupValue(destination.fields, ArticyIdFieldTitle);
                             isValidToLink = string.Equals(requiredDestinationArticyId, destinationArticyId);
                         }
                         if (destination.id == StartEntryID) {
                             isValidToLink = false;
                         }
                         if (isValidToLink) {
                             Link link = new Link();
                             link.originConversationID = conversation.id;
                             link.originDialogueID = origin.id;
                             link.destinationConversationID = conversation.id;
                             link.destinationDialogueID = destination.id;
                             link.isConnector = false;
                             link.priority = ArticyData.ColorToPriority(connection.color);
                             origin.outgoingLinks.Add(link);
                         }
                     }
                 }
             }
         }
     }
 }
 private void ClearArticyProject()
 {
     articyData = null;
     prefs.ConversionSettings.Clear();
     ConverterPrefsTools.DeleteEditorPrefs();
 }
Exemplo n.º 17
0
 /// <summary>
 /// Converts a dialogue fragment, including fields such as text, sequence, and pins, but doesn't
 /// connect it yet.
 /// </summary>
 /// <param name='conversation'>
 /// Conversation.
 /// </param>
 /// <param name='fragment'>
 /// Fragment.
 /// </param>
 private void ConvertDialogueFragment(Conversation conversation, ArticyData.DialogueFragment fragment)
 {
     if (fragment != null) {
         DialogueEntry entry = CreateNewDialogueEntry(conversation, fragment.displayName.DefaultText, fragment.id);
         ConvertLocalizableText(entry, "Dialogue Text", fragment.text);
         ConvertLocalizableText(entry, "Menu Text", fragment.menuText);
         if (prefs.StageDirectionsAreSequences) {
             ConvertLocalizableText(entry, "Sequence", fragment.stageDirections);
         }
         SetFeatureFields(entry.fields, fragment.features);
         Actor actor = FindActorByArticyId(fragment.speakerIdRef);
         entry.ActorID = (actor != null) ? actor.id : 0;
         var conversantEntity = Field.Lookup(entry.fields, "ConversantEntity");
         var conversantActor = (conversantEntity == null) ? null : FindActorByArticyId(conversantEntity.value);
         if (conversantActor != null) {
             entry.ConversantID = conversantActor.id;
         } else {
             entry.ConversantID = (entry.ActorID == conversation.ActorID) ? conversation.ConversantID : conversation.ActorID;
         }
         ConvertPins(entry, fragment.pins);
     }
 }
Exemplo n.º 18
0
 private void ConvertLocalizableText(DialogueEntry entry, string baseFieldTitle, ArticyData.LocalizableText localizableText)
 {
     foreach (KeyValuePair<string, string> kvp in localizableText.localizedString) {
         if (string.IsNullOrEmpty(kvp.Key)) {
             Field.SetValue(entry.fields, baseFieldTitle, RemoveFormattingTags(kvp.Value), FieldType.Text);
         } else {
             string localizedTitle = string.Format("{0} {1}", baseFieldTitle, kvp.Key);
             Field.SetValue(entry.fields, localizedTitle, RemoveFormattingTags(kvp.Value), FieldType.Localization);
         }
     }
 }
Exemplo n.º 19
0
        /// <summary>
        /// This static utility method creates a converter and uses it run the conversion.
        /// </summary>
        /// <param name='articyData'>
        /// Articy data.
        /// </param>
        /// <param name='prefs'>
        /// Prefs.
        /// </param>
        /// <param name='database'>
        /// Dialogue database.
        /// </param>
        public static void ConvertArticyDataToDatabase(ArticyData articyData, ConverterPrefs prefs, DialogueDatabase database)
        {
            ArticyConverter converter = new ArticyConverter();

            converter.Convert(articyData, prefs, database);
        }
Exemplo n.º 20
0
 private void ReviewArticyProject()
 {
     articyData = ArticySchemaTools.LoadArticyDataFromXmlFile(prefs.ProjectFilename, prefs.Encoding);
     if (articyData != null) {
         projectTitle = articyData.ProjectTitle;
         projectVersion = articyData.ProjectVersion;
         projectAuthor = articyData.ProjectAuthor;
         Debug.Log(string.Format("{0}: Loaded {1}", DialogueDebug.Prefix, prefs.ProjectFilename));
     } else {
         Debug.LogError(string.Format("{0}: Failed to load {1}", DialogueDebug.Prefix, prefs.ProjectFilename));
     }
 }
Exemplo n.º 21
0
 /// <summary>
 /// Converts connections into a conversation's link tree.
 /// </summary>
 /// <param name='conversation'>
 /// Conversation.
 /// </param>
 /// <param name='dialogueNode'>
 /// Dialogue node.
 /// </param>
 private void ConvertConnections(Conversation conversation, ArticyData.Node dialogueNode)
 {
     foreach (ArticyData.Node childNode in dialogueNode.nodes) {
         if (childNode.type == ArticyData.NodeType.Connection) {
             ConvertConnection(conversation, LookupConnection(childNode.id));
         }
     }
 }
Exemplo n.º 22
0
 /// <summary>
 /// Converts a hub into a group dialogue entry in a conversation.
 /// </summary>
 /// <param name='conversation'>
 /// Conversation.
 /// </param>
 /// <param name='hub'>
 /// Hub.
 /// </param>
 private void ConvertHub(Conversation conversation, ArticyData.Hub hub)
 {
     if (hub != null) {
         DialogueEntry groupEntry = CreateNewDialogueEntry(conversation, hub.displayName.DefaultText, hub.id);
         SetFeatureFields(groupEntry.fields, hub.features);
         groupEntry.isGroup = true;
         ConvertPins(groupEntry, hub.pins);
     }
 }
Exemplo n.º 23
0
 /// <summary>
 /// Converts dialogue fragment and connection (hub, jump) nodes, and adds them to a 
 /// Dialogue System conversation. First converts all dialogue fragments so the conversation
 /// has a master list of dialogue entries. Then converts all connections to hook up those
 /// entries.
 /// </summary>
 /// <param name='conversation'>
 /// Conversation.
 /// </param>
 /// <param name='dialogueNode'>
 /// Dialogue node.
 /// </param>
 private void ConvertDialogueNodes(Conversation conversation, ArticyData.Node dialogueNode)
 {
     ConvertDialogueFragments(conversation, dialogueNode);
     ConvertConnections(conversation, dialogueNode);
 }
Exemplo n.º 24
0
 /// <summary>
 /// Converts dialogue fragments, adding them a conversation.
 /// </summary>
 /// <param name='conversation'>
 /// Conversation.
 /// </param>
 /// <param name='dialogueNode'>
 /// Dialogue node.
 /// </param>
 private void ConvertDialogueFragments(Conversation conversation, ArticyData.Node dialogueNode)
 {
     entryID = 0;
     foreach (ArticyData.Node childNode in dialogueNode.nodes) {
         if (childNode.type == ArticyData.NodeType.DialogueFragment) {
             ConvertDialogueFragment(conversation, LookupDialogueFragment(childNode.id));
         } else if (childNode.type == ArticyData.NodeType.Hub) {
             ConvertHub(conversation, LookupHub(childNode.id));
         } else if (childNode.type == ArticyData.NodeType.Jump) {
             ConvertJump(conversation, LookupJump(childNode.id));
         } else if (childNode.type == ArticyData.NodeType.Condition) {
             ConvertCondition(conversation, LookupCondition(childNode.id));
         } else if (childNode.type == ArticyData.NodeType.Instruction) {
             ConvertInstruction(conversation, LookupInstruction(childNode.id));
         }
     }
 }
Exemplo n.º 25
0
 /// <summary>
 /// Sets up the conversion process.
 /// </summary>
 /// <param name='articyData'>
 /// Articy data.
 /// </param>
 /// <param name='prefs'>
 /// Prefs.
 /// </param>
 /// <param name='database'>
 /// Dialogue database.
 /// </param>
 private void Setup(ArticyData articyData, ConverterPrefs prefs, DialogueDatabase database)
 {
     this.articyData = articyData;
     this.prefs = prefs;
     this.database = database;
     database.actors = new List<Actor>();
     database.items = new List<Item>();
     database.locations = new List<Location>();
     database.variables = new List<Variable>();
     database.conversations = new List<Conversation>();
     conversationID = 0;
     actorID = 0;
     itemID = 0;
     locationID = 0;
     fullVariableNames.Clear();
     template = Template.FromEditorPrefs();
 }
Exemplo n.º 26
0
 /// <summary>
 /// This static utility method creates a converter and uses it run the conversion.
 /// </summary>
 /// <param name='articyData'>
 /// Articy data.
 /// </param>
 /// <param name='prefs'>
 /// Prefs.
 /// </param>
 /// <param name='database'>
 /// Dialogue database.
 /// </param>
 public static void ConvertArticyDataToDatabase(ArticyData articyData, ConverterPrefs prefs, DialogueDatabase database)
 {
     ArticyConverter converter = new ArticyConverter();
     converter.Convert(articyData, prefs, database);
 }
Exemplo n.º 27
0
 /// <summary>
 /// Converts a condition node into two dialogue entries (one for true, one for false).
 /// </summary>
 /// <param name='conversation'>
 /// Conversation.
 /// </param>
 /// <param name='condition'>
 /// Condition.
 /// </param>
 private void ConvertCondition(Conversation conversation, ArticyData.Condition condition)
 {
     if (condition != null) {
         string trueLuaConditions = ConvertExpression(condition.expression);
         string falseLuaConditions = string.IsNullOrEmpty(trueLuaConditions)
             ? "false" : string.Format("({0}) == false", trueLuaConditions);
         foreach (var pin in condition.pins) {
             if (pin.semantic == ArticyData.SemanticType.Output) {
                 bool isTruePath = (pin.index == 0);
                 var connection = LookupConnectionBySourcePinId(pin.id);
                 if (connection != null) {
                     string title = isTruePath ? condition.expression : string.Format("!({0})", condition.expression);
                     DialogueEntry entry = CreateNewDialogueEntry(conversation, title, condition.id);
                     entry.ActorID = conversation.ConversantID;
                     entry.ConversantID = conversation.ActorID;
                     entry.DialogueText = string.Empty;
                     entry.MenuText = string.Empty;
                     entry.Sequence = "None()";
                     entry.isGroup = true;
                     Field.SetValue(entry.fields, DestinationArticyIdFieldTitle, connection.target.idRef);
                     string luaConditions = isTruePath ? trueLuaConditions : falseLuaConditions;
                     entry.conditionsString = AddToConditions(entry.conditionsString, luaConditions);
                     entry.userScript = AddToUserScript(entry.userScript, ConvertExpression(pin.expression));
                 }
             }
         }
     }
 }
Exemplo n.º 28
0
 /// <summary>
 /// Creates a new Dialogue System conversation from an articy dialogue. This also adds the
 /// conversation's mandatory first dialogue entry, "START".
 /// </summary>
 /// <returns>
 /// The new conversation.
 /// </returns>
 /// <param name='articyDialogue'>
 /// Articy dialogue.
 /// </param>
 private Conversation CreateNewConversation(ArticyData.Dialogue articyDialogue)
 {
     if (articyDialogue != null) {
         conversationID++;
         var conversationTitle = string.Empty;
         if (prefs.FlowFragmentMode == ConverterPrefs.FlowFragmentModes.ConversationGroups) {
             foreach (var flowFragmentName in flowStack) {
                 conversationTitle += flowFragmentName + "/";
             }
         }
         conversationTitle += articyDialogue.displayName.DefaultText;
         Conversation conversation = template.CreateConversation(conversationID, conversationTitle);
         Field.SetValue(conversation.fields, ArticyIdFieldTitle, articyDialogue.id, FieldType.Text);
         Field.SetValue(conversation.fields, "Description", articyDialogue.text.DefaultText, FieldType.Text);
         SetFeatureFields(conversation.fields, articyDialogue.features);
         conversation.ActorID = FindActorIdFromArticyDialogue(articyDialogue, 0);
         conversation.ConversantID = FindActorIdFromArticyDialogue(articyDialogue, 1);
         DialogueEntry startEntry = template.CreateDialogueEntry(StartEntryID, conversationID, "START");
         Field.SetValue(startEntry.fields, ArticyIdFieldTitle, articyDialogue.id, FieldType.Text);
         ConvertPins(startEntry, articyDialogue.pins);
         startEntry.outgoingLinks = new List<Link>();
         Field.SetValue(startEntry.fields, "Sequence", "None()", FieldType.Text);
         conversation.dialogueEntries.Add(startEntry);
         database.conversations.Add(conversation);
         return conversation;
     } else {
         return null;
     }
 }
Exemplo n.º 29
0
 private void ClearArticyProject()
 {
     articyData = null;
     prefs.ConversionSettings.Clear();
 }
Exemplo n.º 30
0
 private int FindActorIdFromArticyDialogue(ArticyData.Dialogue articyDialogue, int index)
 {
     Actor actor = null;
     if (index < articyDialogue.references.Count) {
         actor = FindActorByArticyId(articyDialogue.references[index]);
     }
     return (actor != null) ? actor.id : 0;
 }
Exemplo n.º 31
0
 private void ConvertInstruction(Conversation conversation, ArticyData.Instruction instruction)
 {
     if (instruction != null) {
         DialogueEntry entry = CreateNewDialogueEntry(conversation, instruction.expression, instruction.id);
         entry.ActorID = conversation.ConversantID;
         entry.ConversantID = conversation.ActorID;
         entry.DialogueText = string.Empty;
         entry.MenuText = string.Empty;
         entry.Sequence = "None()";
         entry.isGroup = true;
         entry.conditionsString = string.Empty;
         entry.userScript = AddToUserScript(entry.userScript, ConvertExpression(instruction.expression));
     }
 }
Exemplo n.º 32
0
 /// <summary>
 /// Converts a dialogue hierarchy node into a conversation.
 /// </summary>
 /// <param name='dialogueNode'>
 /// Dialogue node.
 /// </param>
 private void ConvertDialogue(ArticyData.Node dialogueNode)
 {
     if (prefs.ConversionSettings.GetConversionSetting(dialogueNode.id).Include) {
         if (articyData.dialogues.ContainsKey(dialogueNode.id)) {
             Conversation conversation = CreateNewConversation(articyData.dialogues[dialogueNode.id]);
             if (conversation != null) ConvertDialogueNodes(conversation, dialogueNode);
         } else {
             Debug.LogWarning(string.Format("{0}: Can't find dialogue ID {1}", DialogueDebug.Prefix, dialogueNode.id));
         }
     }
 }
Exemplo n.º 33
0
 private void ClearArticyProject()
 {
     articyData = null;
     prefs.ConversionSettings.Clear();
 }
Exemplo n.º 34
0
 /// <summary>
 /// Converts a jump into a group dialogue entry in a conversation.
 /// </summary>
 /// <param name='conversation'>
 /// Conversation.
 /// </param>
 /// <param name='jump'>
 /// Jump.
 /// </param>
 private void ConvertJump(Conversation conversation, ArticyData.Jump jump)
 {
     if (jump != null) {
         DialogueEntry jumpEntry = CreateNewDialogueEntry(conversation, jump.displayName.DefaultText, jump.id);
         SetFeatureFields(jumpEntry.fields, jump.features);
         jumpEntry.isGroup = true;
         ConvertPins(jumpEntry, jump.pins);
         DialogueEntry destination = FindDialogueEntryByArticyId(conversation, jump.target.idRef);
         if (destination != null) {
             Link link = new Link();
             link.originConversationID = conversation.id;
             link.originDialogueID = jumpEntry.id;
             link.destinationConversationID = conversation.id;
             link.destinationDialogueID = destination.id;
             link.isConnector = false;
             link.priority = ConditionPriority.Normal;
             jumpEntry.outgoingLinks.Add(link);
         }
     }
 }