private static void SetConversationStartCutsceneToNone(Conversation conversation)
        {
            DialogueEntry entry = conversation.GetFirstDialogueEntry();

            if (entry == null)
            {
                if (DialogueDebug.logWarnings)
                {
                    Debug.LogWarning(string.Format("{0}: Conversation '{1}' doesn't have a START dialogue entry.", new System.Object[] { DialogueDebug.Prefix, conversation.Title }));
                }
            }
            else
            {
                if (string.IsNullOrEmpty(entry.currentSequence))
                {
                    if (Field.FieldExists(entry.fields, DialogueSystemFields.Sequence))
                    {
                        entry.currentSequence = SequencerKeywords.NoneCommand;
                    }
                    else
                    {
                        entry.fields.Add(new Field(DialogueSystemFields.Sequence, SequencerKeywords.NoneCommand, FieldType.Text));
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Initializes a new ConversationModel.
        /// </summary>
        /// <param name="database">The database to use.</param>
        /// <param name="title">The title of the conversation in the database.</param>
        /// <param name="actor">Actor.</param>
        /// <param name="conversant">Conversant.</param>
        /// <param name="allowLuaExceptions">If set to <c>true</c> allow Lua exceptions.</param>
        /// <param name="isDialogueEntryValid">Is dialogue entry valid.</param>
        /// <param name="initialDialogueEntryID">Initial dialogue entry ID (-1 to start at beginning).</param>
        /// <param name="stopAtFirstValid">If set to <c>true</c> stop at first valid link from the initial entry.</param>
        /// <param name="skipExecution">IF set to <c>true</c>, doesn't run the Lua Script or OnExecute event on the initial entry.</param>
        public ConversationModel(DialogueDatabase database, string title, Transform actor, Transform conversant,
                                 bool allowLuaExceptions, IsDialogueEntryValidDelegate isDialogueEntryValid,
                                 int initialDialogueEntryID = -1, bool stopAtFirstValid = false, bool skipExecution = false)
        {
            this.m_allowLuaExceptions = allowLuaExceptions;
            this.m_database           = database;
            this.isDialogueEntryValid = isDialogueEntryValid;
            DisplaySettings displaySettings = DialogueManager.displaySettings;

            if (displaySettings != null)
            {
                if (displaySettings.cameraSettings != null)
                {
                    m_entrytagFormat = displaySettings.cameraSettings.entrytagFormat;
                }
                if (displaySettings.inputSettings != null)
                {
                    m_emTagForOldResponses     = displaySettings.inputSettings.emTagForOldResponses;
                    m_emTagForInvalidResponses = displaySettings.inputSettings.emTagForInvalidResponses;
                    m_includeInvalidEntries    = displaySettings.GetIncludeInvalidEntries();
                }
            }
            Conversation conversation = database.GetConversation(title);

            if (conversation != null)
            {
                SetParticipants(conversation, actor, conversant);
                if (initialDialogueEntryID == -1)
                {
                    firstState = GetState(conversation.GetFirstDialogueEntry(), true, stopAtFirstValid, skipExecution);
                    FixFirstStateSequence();
                }
                else
                {
                    firstState = GetState(conversation.GetDialogueEntry(initialDialogueEntryID), true, stopAtFirstValid, skipExecution);
                }
            }
            else
            {
                firstState = null;
                if (DialogueDebug.logErrors)
                {
                    Debug.LogWarning(string.Format("{0}: Conversation '{1}' not found in database.", new System.Object[] { DialogueDebug.Prefix, title }));
                }
            }
        }
Пример #3
0
        private void SetConversationStartCutsceneToNone(Conversation conversation)
        {
            DialogueEntry entry = conversation.GetFirstDialogueEntry();

            if (entry == null)
            {
                Debug.LogWarning(string.Format("{0}: Conversation '{1}' doesn't have a START dialogue entry.", DialogueDebug.Prefix, conversation.Title));
            }
            else
            {
                if (string.IsNullOrEmpty(entry.Sequence))
                {
                    if (Field.FieldExists(entry.fields, "Sequence"))
                    {
                        entry.Sequence = "None()";
                    }
                    else
                    {
                        entry.fields.Add(new Field("Sequence", "None()", FieldType.Text));
                    }
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Initializes a new ConversationModel.
        /// </summary>
        /// <param name='database'>
        /// The database to use.
        /// </param>
        /// <param name='title'>
        /// The title of the conversation in the database.
        /// </param>
        /// <param name='actor'>
        /// Actor.
        /// </param>
        /// <param name='conversant'>
        /// Conversant.
        /// </param>
        public ConversationModel(DialogueDatabase database, string title, Transform actor, Transform conversant,
                                 bool allowLuaExceptions, IsDialogueEntryValidDelegate isDialogueEntryValid)
        {
            this.allowLuaExceptions   = allowLuaExceptions;
            this.database             = database;
            this.IsDialogueEntryValid = isDialogueEntryValid;
            Conversation conversation = database.GetConversation(title);

            if (conversation != null)
            {
                SetParticipants(conversation, actor, conversant);
                FirstState = GetState(conversation.GetFirstDialogueEntry());
                FixFirstStateSequence();
            }
            else
            {
                FirstState = null;
                if (DialogueDebug.LogErrors)
                {
                    Debug.LogWarning(string.Format("{0}: Conversation '{1}' not found in database.", new System.Object[] { DialogueDebug.Prefix, title }));
                }
            }
            DisplaySettings displaySettings = DialogueManager.DisplaySettings;

            if (displaySettings != null)
            {
                if (displaySettings.cameraSettings != null)
                {
                    entrytagFormat = displaySettings.cameraSettings.entrytagFormat;
                }
                if (displaySettings.inputSettings != null)
                {
                    emTagForOldResponses = displaySettings.inputSettings.emTagForOldResponses;
                }
            }
        }
 private static void SetConversationStartCutsceneToNone(Conversation conversation)
 {
     DialogueEntry entry = conversation.GetFirstDialogueEntry();
     if (entry == null) {
         if (DialogueDebug.LogWarnings) Debug.LogWarning(string.Format("{0}: Conversation '{1}' doesn't have a START dialogue entry.", new System.Object[] { DialogueDebug.Prefix, conversation.Title }));
     } else {
         if (string.IsNullOrEmpty(entry.Sequence)) {
             if (Field.FieldExists(entry.fields, "Sequence")) {
                 entry.Sequence = "None()";
             } else {
                 entry.fields.Add(new Field("Sequence", "None()", FieldType.Text));
             }
         }
     }
 }