コード例 #1
0
        public static bool FindQuestInDialogueSystemTrigger(DialogueSystemTrigger dialogueSystemTrigger, string originalName, string replacementName, bool replace, bool isPrefab)
        {
            var found = false;

            if (dialogueSystemTrigger != null)
            {
                foreach (var questCondition in dialogueSystemTrigger.condition.questConditions)
                {
                    if (questCondition.questName == originalName)
                    {
                        found = true;
                        if (replace)
                        {
                            questCondition.questName = replacementName;
                        }
                    }
                }
                if (dialogueSystemTrigger.questName == originalName)
                {
                    found = true;
                    if (replace)
                    {
                        dialogueSystemTrigger.questName = replacementName;
                    }
                }
            }
            if (found && replace && isPrefab)
            {
                EditorUtility.SetDirty(dialogueSystemTrigger);
            }
            return(found);
        }
 public override void OnInspectorGUI()
 {
     trigger = target as DialogueSystemTrigger;
     if (trigger == null)
     {
         return;
     }
     serializedObject.Update();
     DrawTopInfo();
     DrawConditions();
     DrawActions();
     serializedObject.ApplyModifiedProperties();
 }
コード例 #3
0
 private string GetDialogueSystemTriggerSummary(DialogueSystemTrigger trigger)
 {
     if (trigger == null)
     {
         return(string.Empty);
     }
     if (!string.IsNullOrEmpty(trigger.conversation))
     {
         return("Conversation '" + trigger.conversation + "'");
     }
     if (trigger.barkSource == DialogueSystemTrigger.BarkSource.Conversation && !string.IsNullOrEmpty(trigger.barkConversation))
     {
         return("Cark conversation '" + trigger.barkConversation + "'");
     }
     if (trigger.barkSource == DialogueSystemTrigger.BarkSource.Text && !string.IsNullOrEmpty(trigger.barkText))
     {
         return("Bark '" + trigger.barkText + "'");
     }
     if (!string.IsNullOrEmpty(trigger.sequence))
     {
         return("Play sequence '" + trigger.sequence + "'");
     }
     if (!string.IsNullOrEmpty(trigger.luaCode))
     {
         return("Run Lua '" + trigger.luaCode + "'");
     }
     if (!string.IsNullOrEmpty(trigger.questName))
     {
         if (trigger.setQuestState && trigger.setQuestEntryState)
         {
             return("Set quest '" + trigger.questName + "' " + trigger.questState + " & entry " + trigger.questEntryNumber + " " + trigger.questEntryState);
         }
         if (trigger.setQuestState)
         {
             return("Set quest '" + trigger.questName + "' " + trigger.questState);
         }
         if (trigger.setQuestEntryState && trigger.setQuestEntryState)
         {
             return("Set quest '" + trigger.questName + "' entry " + trigger.questEntryNumber + " " + trigger.questEntryState);
         }
     }
     return(string.Empty);
 }