private void DrawSubtitleSettings() { foldouts.subtitleSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Subtitle Settings", "Subtitle settings.", foldouts.subtitleSettingsFoldout, false); if (foldouts.subtitleSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var subtitleSettings = displaySettingsProperty.FindPropertyRelative("subtitleSettings"); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("richTextEmphases"), new GUIContent("Use Rich Text For [em#] Tags", "Use rich text codes for [em#] markup tags. If unticked, [em#] tag will apply color to entire text."), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("showNPCSubtitlesDuringLine"), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("showNPCSubtitlesWithResponses"), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("showPCSubtitlesDuringLine"), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("allowPCSubtitleReminders"), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("skipPCSubtitleAfterResponseMenu"), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("subtitleCharsPerSecond"), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("minSubtitleSeconds"), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("continueButton"), true); EditorGUILayout.PropertyField(subtitleSettings.FindPropertyRelative("informSequenceStartAndEnd"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawOtherSettings() { foldouts.otherSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Other Settings", "Miscellaneous settings.", foldouts.otherSettingsFoldout); if (foldouts.otherSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var dontDestroyOnLoadProperty = serializedObject.FindProperty("dontDestroyOnLoad"); EditorGUILayout.PropertyField(serializedObject.FindProperty("allowOnlyOneInstance"), true); var previousDontDestroyOnLoadValue = dontDestroyOnLoadProperty.boolValue; EditorGUILayout.PropertyField(dontDestroyOnLoadProperty, true); if (previousDontDestroyOnLoadValue == true && dontDestroyOnLoadProperty.boolValue == false) { if (!VerifyDisableDontDestroyOnLoad()) { dontDestroyOnLoadProperty.boolValue = true; } } EditorGUILayout.PropertyField(serializedObject.FindProperty("preloadResources"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("instantiateDatabase"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("includeSimStatus"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("allowSimultaneousConversations"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("dialogueTimeMode"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("debugLevel"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawSetEnabledAction() { foldouts.setEnabledFoldout = EditorWindowTools.EditorGUILayoutFoldout("Set Components Enabled/Disabled", "Set components active or inactive.", foldouts.setEnabledFoldout, false); if (foldouts.setEnabledFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); if (setEnabledList.count > 0) { EditorGUILayout.LabelField("Click on a row to edit its conditions."); } setEnabledList.DoLayoutList(); if (0 <= setEnabledList.index && setEnabledList.index < setEnabledList.count) { EditorWindowTools.EditorGUILayoutBeginIndent(); EditorGUILayout.PropertyField(setEnabledList.serializedProperty.GetArrayElementAtIndex(setEnabledList.index).FindPropertyRelative("condition"), true); EditorWindowTools.EditorGUILayoutEndIndent(); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawSetAnimatorStateAction() { foldouts.setAnimatorStateFoldout = EditorWindowTools.EditorGUILayoutFoldout("Set Animator States", "Set Animator states on one or more GameObjects.", foldouts.setAnimatorStateFoldout, false); if (foldouts.setAnimatorStateFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); if (setAnimatorStateList.count > 0) { EditorGUILayout.LabelField("Click on a row to edit its conditions."); } setAnimatorStateList.DoLayoutList(); if (0 <= setAnimatorStateList.index && setAnimatorStateList.index < setAnimatorStateList.count) { EditorWindowTools.EditorGUILayoutBeginIndent(); EditorGUILayout.PropertyField(setAnimatorStateList.serializedProperty.GetArrayElementAtIndex(setAnimatorStateList.index).FindPropertyRelative("condition"), true); EditorWindowTools.EditorGUILayoutEndIndent(); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawSetActiveAction() { foldouts.setActiveFoldout = EditorWindowTools.EditorGUILayoutFoldout("Set GameObjects Active/Inactive", "Set GameObjects active or inactive.", foldouts.setActiveFoldout, false); if (foldouts.setActiveFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); if (setActiveList.count > 0) { EditorGUILayout.LabelField("Click on a row to edit its conditions."); } setActiveList.DoLayoutList(); if (0 <= setActiveList.index && setActiveList.index < setActiveList.count) { EditorWindowTools.EditorGUILayoutBeginIndent(); EditorGUILayout.PropertyField(setActiveList.serializedProperty.GetArrayElementAtIndex(setActiveList.index).FindPropertyRelative("condition"), true); EditorWindowTools.EditorGUILayoutEndIndent(); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawLuaAction() { foldouts.luaFoldout = EditorWindowTools.EditorGUILayoutFoldout("Run Lua Code", "Run Lua code.", foldouts.luaFoldout, false); if (foldouts.luaFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); if (EditorTools.selectedDatabase != luaScriptWizard.database) { luaScriptWizard.database = EditorTools.selectedDatabase; luaScriptWizard.RefreshWizardResources(); } serializedObject.ApplyModifiedProperties(); EditorGUI.BeginChangeCheck(); var newLuaCode = luaScriptWizard.Draw(new GUIContent("Lua Code", "The Lua code to run when the condition is true."), trigger.luaCode); var changed = EditorGUI.EndChangeCheck(); serializedObject.Update(); if (changed) { serializedObject.FindProperty("luaCode").stringValue = newLuaCode; } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawConversationAction() { foldouts.conversationFoldout = EditorWindowTools.EditorGUILayoutFoldout("Start Conversation", "Start a conversation.", foldouts.conversationFoldout, false); if (foldouts.conversationFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.PropertyField(serializedObject.FindProperty("conversation"), true); if (!string.IsNullOrEmpty(serializedObject.FindProperty("conversation").stringValue)) { EditorGUILayout.PropertyField(serializedObject.FindProperty("conversationActor"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("conversationConversant"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("exclusive"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("skipIfNoValidEntries"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("stopConversationOnTriggerExit"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("stopConversationIfTooFar"), true); if (serializedObject.FindProperty("stopConversationIfTooFar").boolValue) { EditorGUILayout.PropertyField(serializedObject.FindProperty("maxConversationDistance"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("monitorConversationDistanceFrequency"), true); } EditorGUILayout.PropertyField(serializedObject.FindProperty("showCursorDuringConversation"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("pauseGameDuringConversation"), true); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawSequenceAction() { foldouts.sequenceFoldout = EditorWindowTools.EditorGUILayoutFoldout("Play Sequence", "Play a sequence.", foldouts.sequenceFoldout, false); if (foldouts.sequenceFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); if (DialogueTriggerEventDrawer.IsEnableOrStartEnumIndex(triggerProperty.enumValueIndex)) { EditorGUILayout.PropertyField(serializedObject.FindProperty("waitOneFrameOnStartOrEnable"), new GUIContent("Wait 1 Frame", "Tick to wait one frame to allow other components to finish their OnStart/OnEnable"), true); } serializedObject.ApplyModifiedProperties(); EditorGUI.BeginChangeCheck(); var newSequence = SequenceEditorTools.DrawLayout(new GUIContent("Sequence"), trigger.sequence, ref sequenceRect); var changed = EditorGUI.EndChangeCheck(); serializedObject.Update(); if (changed) { serializedObject.FindProperty("sequence").stringValue = newSequence; } EditorGUILayout.PropertyField(serializedObject.FindProperty("sequenceSpeaker"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("sequenceListener"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawAlertAction() { foldouts.alertFoldout = EditorWindowTools.EditorGUILayoutFoldout("Show Alert", "Show an alert message.", foldouts.alertFoldout, false); if (foldouts.alertFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.PropertyField(serializedObject.FindProperty("alertMessage"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("textTable"), true); var alertDurationProperty = serializedObject.FindProperty("alertDuration"); bool specifyAlertDuration = !Mathf.Approximately(0, alertDurationProperty.floatValue); specifyAlertDuration = EditorGUILayout.Toggle(new GUIContent("Specify Duration", "Tick to specify an alert duration; untick to use the default"), specifyAlertDuration); if (specifyAlertDuration) { if (Mathf.Approximately(0, alertDurationProperty.floatValue)) { alertDurationProperty.floatValue = 5; } EditorGUILayout.PropertyField(serializedObject.FindProperty("alertDuration"), true); } else { alertDurationProperty.floatValue = 0; } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawPersistentDataSettings() { foldouts.persistentDataSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Persistent Data Settings", "Settings used by the save subsystem.", foldouts.persistentDataSettingsFoldout); if (foldouts.persistentDataSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("recordPersistentDataOn"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("includeStatusAndRelationshipData"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("includeActorData"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("includeAllItemData"), new GUIContent("Include All Item & Quest Data"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("includeLocationData"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("includeAllConversationFields"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("saveConversationSimStatusWithField"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("saveDialogueEntrySimStatusWithField"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("asyncGameObjectBatchSize"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("asyncDialogueEntryBatchSize"), true); EditorGUILayout.PropertyField(persistentDataSettingsProperty.FindPropertyRelative("initializeNewVariables"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawInputSettings() { foldouts.inputSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Input Settings", "Input and response menu settings.", foldouts.inputSettingsFoldout, false); if (foldouts.inputSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var inputSettings = displaySettingsProperty.FindPropertyRelative("inputSettings"); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("alwaysForceResponseMenu"), true); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("includeInvalidEntries"), true); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("responseTimeout"), true); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("responseTimeoutAction"), true); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("emTagForOldResponses"), new GUIContent("[em#] Tag For Old Responses", "The [em#] tag to wrap around responses that have been previously chosen."), true); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("emTagForInvalidResponses"), new GUIContent("[em#] Tag For Invalid Responses", "The [em#] tag to wrap around invalid responses. These responses are only shown if Include Invalid Entries is ticked."), true); try { EditorWindowTools.StartIndentedSection(); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("qteButtons"), new GUIContent("QTE Input Buttons", "Input buttons mapped to QTEs."), true); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("cancel"), new GUIContent("Cancel Subtitle Input", "Key or button that cancels subtitle sequences."), true); EditorGUILayout.PropertyField(inputSettings.FindPropertyRelative("cancelConversation"), new GUIContent("Cancel Conversation Input", "Key or button that cancels active conversation while in response menu."), true); } finally { EditorWindowTools.EndIndentedSection(); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawConversationAction() { foldouts.conversationFoldout = EditorWindowTools.EditorGUILayoutFoldout("Start Conversation", "Start a conversation.", foldouts.conversationFoldout, false); if (foldouts.conversationFoldout) { try { var conversationProperty = serializedObject.FindProperty("conversation"); var hadConversation = !string.IsNullOrEmpty(conversationProperty.stringValue); EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.PropertyField(conversationProperty, true); if (string.IsNullOrEmpty(conversationProperty.stringValue)) { if (hadConversation) { showConversationAction = false; } } else { EditorGUILayout.PropertyField(serializedObject.FindProperty("conversationActor"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("conversationConversant"), true); var entryIDProperty = serializedObject.FindProperty("startConversationEntryID"); var specifyEntryID = EditorGUILayout.Toggle(new GUIContent("Specify Starting Entry", "Start conversation at a specific entry ID."), (entryIDProperty.intValue != -1)); if (specifyEntryID) { entryIDProperty.intValue = Mathf.Max(0, EditorGUILayout.IntField(new GUIContent("Entry ID", "Start at this entry ID."), entryIDProperty.intValue)); } else { entryIDProperty.intValue = -1; } EditorGUILayout.PropertyField(serializedObject.FindProperty("exclusive"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("skipIfNoValidEntries"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("stopConversationOnTriggerExit"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("stopConversationIfTooFar"), true); if (serializedObject.FindProperty("stopConversationIfTooFar").boolValue) { EditorGUILayout.PropertyField(serializedObject.FindProperty("maxConversationDistance"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("monitorConversationDistanceFrequency"), true); } EditorGUILayout.PropertyField(serializedObject.FindProperty("showCursorDuringConversation"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("pauseGameDuringConversation"), true); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawBarkAction() { foldouts.barkFoldout = EditorWindowTools.EditorGUILayoutFoldout("Bark", "Bark.", foldouts.barkFoldout, false); if (foldouts.barkFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.BeginHorizontal(); var barkSourceProperty = serializedObject.FindProperty("barkSource"); EditorGUILayout.PropertyField(barkSourceProperty, true); if (GUILayout.Button("x", GUILayout.Width(18), GUILayout.Height(14))) { serializedObject.FindProperty("barkSource").enumValueIndex = 0; serializedObject.FindProperty("barkConversation").stringValue = string.Empty; serializedObject.FindProperty("barkText").stringValue = string.Empty; serializedObject.FindProperty("barkTextSequence").stringValue = string.Empty; showBarkAction = false; } EditorGUILayout.EndHorizontal(); switch ((DialogueSystemTrigger.BarkSource)barkSourceProperty.enumValueIndex) { case DialogueSystemTrigger.BarkSource.Conversation: var barkConversationProperty = serializedObject.FindProperty("barkConversation"); EditorGUILayout.PropertyField(barkConversationProperty, true); if (!string.IsNullOrEmpty(barkConversationProperty.stringValue)) { EditorGUILayout.PropertyField(serializedObject.FindProperty("barkOrder"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barker"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barkTarget"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("skipBarkIfNoValidEntries"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("allowBarksDuringConversations"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("cacheBarkLines"), true); } break; case DialogueSystemTrigger.BarkSource.Text: EditorGUILayout.PropertyField(serializedObject.FindProperty("barkText"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barkTextSequence"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barker"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barkTarget"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("allowBarksDuringConversations"), true); break; } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawQuestAction() { foldouts.questFoldout = EditorWindowTools.EditorGUILayoutFoldout("Set Quest State", "Set quest states.", foldouts.questFoldout, false); if (foldouts.questFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); // Quest picker: if (questPicker != null) { serializedObject.ApplyModifiedProperties(); questPicker.Draw(); var hadQuestName = !string.IsNullOrEmpty(trigger.questName); trigger.questName = questPicker.currentQuest; trigger.useQuestNamePicker = questPicker.usePicker; trigger.selectedDatabase = questPicker.database; if (EditorTools.selectedDatabase == null) { EditorTools.selectedDatabase = trigger.selectedDatabase; } if (hadQuestName && string.IsNullOrEmpty(trigger.questName)) { showSetQuestStateAction = false; } serializedObject.Update(); } // Quest state: EditorGUILayout.PropertyField(serializedObject.FindProperty("setQuestState"), true); if (serializedObject.FindProperty("setQuestState").boolValue) { EditorGUILayout.PropertyField(serializedObject.FindProperty("questState"), true); } // Quest entry state: EditorGUILayout.PropertyField(serializedObject.FindProperty("setQuestEntryState"), true); if (serializedObject.FindProperty("setQuestEntryState").boolValue) { EditorGUILayout.PropertyField(serializedObject.FindProperty("questEntryNumber"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("questEntryState"), true); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawSendMessageAction() { foldouts.sendMessageFoldout = EditorWindowTools.EditorGUILayoutFoldout("Send Messages", "Use SendMessage to call methods on one or more GameObjects.", foldouts.sendMessageFoldout, false); if (foldouts.sendMessageFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); sendMessageList.DoLayoutList(); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawUnityEventAction() { foldouts.unityEventFoldout = EditorWindowTools.EditorGUILayoutFoldout("OnExecute() UnityEvent", "Connect other events in the Inspector.", foldouts.unityEventFoldout, false); if (foldouts.unityEventFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.PropertyField(serializedObject.FindProperty("onExecute"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawBarkSettings() { foldouts.barkSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Bark Settings", "Bark settings.", foldouts.barkSettingsFoldout, false); if (foldouts.barkSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var barkSettings = displaySettingsProperty.FindPropertyRelative("barkSettings"); EditorGUILayout.PropertyField(barkSettings.FindPropertyRelative("allowBarksDuringConversations"), true); EditorGUILayout.PropertyField(barkSettings.FindPropertyRelative("barkCharsPerSecond"), true); EditorGUILayout.PropertyField(barkSettings.FindPropertyRelative("minBarkSeconds"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawAlertSettings() { foldouts.alertSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Alert Settings", "Alert settings.", foldouts.alertSettingsFoldout, false); if (foldouts.alertSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var alertSettings = displaySettingsProperty.FindPropertyRelative("alertSettings"); EditorGUILayout.PropertyField(alertSettings.FindPropertyRelative("allowAlertsDuringConversations"), true); EditorGUILayout.PropertyField(alertSettings.FindPropertyRelative("alertCheckFrequency"), true); EditorGUILayout.PropertyField(alertSettings.FindPropertyRelative("alertCharsPerSecond"), true); EditorGUILayout.PropertyField(alertSettings.FindPropertyRelative("minAlertSeconds"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawLocalizationSettings() { foldouts.localizationSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Localization Settings", "Language localization settings.", foldouts.localizationSettingsFoldout, false); if (foldouts.localizationSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var localizationSettings = displaySettingsProperty.FindPropertyRelative("localizationSettings"); EditorGUILayout.PropertyField(localizationSettings.FindPropertyRelative("language"), true); EditorGUILayout.PropertyField(localizationSettings.FindPropertyRelative("useSystemLanguage"), true); EditorGUILayout.PropertyField(localizationSettings.FindPropertyRelative("textTable"), true); //---Was: EditorGUILayout.PropertyField(localizationSettings.FindPropertyRelative("localizedText"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawConditions() { foldouts.conditionFoldout = EditorWindowTools.EditorGUILayoutFoldout("Conditions", "Conditions that must be true for trigger to fire.", foldouts.conditionFoldout); if (foldouts.conditionFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); ConditionPropertyDrawer.hideMainFoldout = true; var conditionProperty = serializedObject.FindProperty("condition"); conditionProperty.isExpanded = true; EditorGUILayout.PropertyField(conditionProperty, true); ConditionPropertyDrawer.hideMainFoldout = false; } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawBarkAction() { foldouts.barkFoldout = EditorWindowTools.EditorGUILayoutFoldout("Bark", "Bark.", foldouts.barkFoldout, false); if (foldouts.barkFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var barkSourceProperty = serializedObject.FindProperty("barkSource"); EditorGUILayout.PropertyField(barkSourceProperty, true); switch ((DialogueSystemTrigger.BarkSource)barkSourceProperty.enumValueIndex) { case DialogueSystemTrigger.BarkSource.Conversation: var barkConversationProperty = serializedObject.FindProperty("barkConversation"); EditorGUILayout.PropertyField(barkConversationProperty, true); if (!string.IsNullOrEmpty(barkConversationProperty.stringValue)) { EditorGUILayout.PropertyField(serializedObject.FindProperty("barkOrder"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barker"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barkTarget"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("skipBarkIfNoValidEntries"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("allowBarksDuringConversations"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("cacheBarkLines"), true); } break; case DialogueSystemTrigger.BarkSource.Text: EditorGUILayout.PropertyField(serializedObject.FindProperty("barkText"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barkTextSequence"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barker"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("barkTarget"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("allowBarksDuringConversations"), true); break; } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawDisplaySettings() { foldouts.displaySettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Display Settings", "Settings related to display and input.", foldouts.displaySettingsFoldout); if (foldouts.displaySettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.PropertyField(displaySettingsProperty.FindPropertyRelative("dialogueUI"), true); DrawLocalizationSettings(); DrawSubtitleSettings(); DrawCameraSettings(); DrawInputSettings(); DrawBarkSettings(); DrawAlertSettings(); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawOtherSettings() { foldouts.otherSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Other Settings", "Miscellaneous settings.", foldouts.otherSettingsFoldout); if (foldouts.otherSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.PropertyField(serializedObject.FindProperty("allowOnlyOneInstance"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("dontDestroyOnLoad"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("preloadResources"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("instantiateDatabase"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("includeSimStatus"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("dialogueTimeMode"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("debugLevel"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
protected virtual void DrawAlertAction() { foldouts.alertFoldout = EditorWindowTools.EditorGUILayoutFoldout("Show Alert", "Show an alert message.", foldouts.alertFoldout, false); if (foldouts.alertFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(serializedObject.FindProperty("alertMessage"), true); if (GUILayout.Button("x", GUILayout.Width(18), GUILayout.Height(14))) { serializedObject.FindProperty("alertMessage").stringValue = string.Empty; showAlertAction = false; } EditorGUILayout.EndHorizontal(); EditorGUILayout.PropertyField(serializedObject.FindProperty("textTable"), true); var alertDurationProperty = serializedObject.FindProperty("alertDuration"); bool specifyAlertDuration = !Mathf.Approximately(0, alertDurationProperty.floatValue); specifyAlertDuration = EditorGUILayout.Toggle(new GUIContent("Specify Duration", "Tick to specify an alert duration; untick to use the default"), specifyAlertDuration); if (specifyAlertDuration) { if (Mathf.Approximately(0, alertDurationProperty.floatValue)) { alertDurationProperty.floatValue = 5; } EditorGUILayout.PropertyField(serializedObject.FindProperty("alertDuration"), true); } else { alertDurationProperty.floatValue = 0; } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawLocalizationSettings() { foldouts.localizationSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Localization Settings", "Language localization settings.", foldouts.localizationSettingsFoldout, false); if (foldouts.localizationSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var localizationSettings = displaySettingsProperty.FindPropertyRelative("localizationSettings"); EditorGUILayout.PropertyField(localizationSettings.FindPropertyRelative("language"), true); EditorGUILayout.PropertyField(localizationSettings.FindPropertyRelative("useSystemLanguage"), true); EditorGUILayout.PropertyField(localizationSettings.FindPropertyRelative("textTable"), true); if (GUILayout.Button(new GUIContent("Reset Language PlayerPrefs", "Delete the language selection saved in PlayerPrefs."))) { ResetLanguagePlayerPrefs(); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
private void DrawCameraSettings() { foldouts.cameraSettingsFoldout = EditorWindowTools.EditorGUILayoutFoldout("Camera & Cutscene Settings", "Camera and cutscene sequencer settings.", foldouts.cameraSettingsFoldout, false); if (foldouts.cameraSettingsFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); var cameraSettings = displaySettingsProperty.FindPropertyRelative("cameraSettings"); EditorGUILayout.PropertyField(cameraSettings.FindPropertyRelative("sequencerCamera"), true); EditorGUILayout.PropertyField(cameraSettings.FindPropertyRelative("alternateCameraObject"), true); EditorGUILayout.PropertyField(cameraSettings.FindPropertyRelative("cameraAngles"), true); EditorGUILayout.PropertyField(cameraSettings.FindPropertyRelative("defaultSequence"), true); EditorGUILayout.PropertyField(cameraSettings.FindPropertyRelative("defaultPlayerSequence"), true); EditorGUILayout.PropertyField(cameraSettings.FindPropertyRelative("defaultResponseMenuSequence"), true); EditorGUILayout.PropertyField(cameraSettings.FindPropertyRelative("entrytagFormat"), true); EditorGUILayout.PropertyField(cameraSettings.FindPropertyRelative("disableInternalSequencerCommands"), true); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }
public override void OnInspectorGUI() { var trigger = target as ConditionObserver; if (trigger == null) { return; } serializedObject.Update(); // Reference database: EditorTools.selectedDatabase = EditorGUILayout.ObjectField(new GUIContent("Reference Database", "Database to use for pop-up menus. Assumes this database will be in memory at runtime."), EditorTools.selectedDatabase, typeof(DialogueDatabase), false) as DialogueDatabase; // Frequency, once, observeGameObject: EditorGUILayout.PropertyField(serializedObject.FindProperty("frequency"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("once"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("observeGameObject"), true); // Condition: foldouts.conditionFoldout = EditorWindowTools.EditorGUILayoutFoldout("Conditions", "Conditions that must be true for trigger to fire.", foldouts.conditionFoldout); if (foldouts.conditionFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); ConditionPropertyDrawer.hideMainFoldout = true; var conditionProperty = serializedObject.FindProperty("condition"); conditionProperty.isExpanded = true; EditorGUILayout.PropertyField(conditionProperty, true); ConditionPropertyDrawer.hideMainFoldout = false; } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } // Action: foldouts.actionFoldout = EditorWindowTools.EditorGUILayoutFoldout("Actions", "Actions to run when the observed condition becomes true.", foldouts.actionFoldout); if (foldouts.actionFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); serializedObject.ApplyModifiedProperties(); // Lua code / wizard: if (EditorTools.selectedDatabase != luaScriptWizard.database) { luaScriptWizard.database = EditorTools.selectedDatabase; luaScriptWizard.RefreshWizardResources(); } EditorGUI.BeginChangeCheck(); var newLuaCode = luaScriptWizard.Draw(new GUIContent("Lua Code", "The Lua code to run when the condition is true"), trigger.luaCode); // Sequence: var newSequence = SequenceEditorTools.DrawLayout(new GUIContent("Sequence"), trigger.sequence, ref sequenceRect, ref sequenceSyntaxState); // Quest: if (EditorTools.selectedDatabase != questPicker.database) { questPicker.database = EditorTools.selectedDatabase; questPicker.UpdateTitles(); } questPicker.Draw(); var newQuestName = questPicker.currentQuest; var newUseQuestNamePicker = questPicker.usePicker; var changed = EditorGUI.EndChangeCheck(); serializedObject.Update(); if (changed) { serializedObject.FindProperty("luaCode").stringValue = newLuaCode; serializedObject.FindProperty("sequence").stringValue = newSequence; serializedObject.FindProperty("questName").stringValue = newQuestName; serializedObject.FindProperty("useQuestNamePicker").boolValue = newUseQuestNamePicker; } EditorGUILayout.PropertyField(serializedObject.FindProperty("questState"), true); // Alert message: EditorGUILayout.PropertyField(serializedObject.FindProperty("alertMessage"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("textTable"), true); // Send Messages list: DrawSendMessageAction(); } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } serializedObject.ApplyModifiedProperties(); }
protected virtual void DrawActions() { foldouts.actionFoldout = EditorWindowTools.EditorGUILayoutFoldout("Actions", "Perform these actions when trigger fires.", foldouts.actionFoldout); if (foldouts.actionFoldout) { try { EditorWindowTools.EditorGUILayoutBeginGroup(); EditorGUILayout.BeginHorizontal(); if (showSetQuestStateAction || showRunLuaCodeAction || showPlaySequenceAction || showAlertAction || showSendMessagesAction || showBarkAction || showConversationAction || showSetActiveAction || showSetEnabledAction || showAnimatorStatesAction || showUnityEventAction) { EditorGUILayout.LabelField("Actions are performed in this order:", EditorTools.GUILayoutLabelWidth("Actions are performed in this order:")); } else { EditorGUILayout.LabelField("Click Add Action:", EditorTools.GUILayoutLabelWidth("Click Add Action to add new action types:")); } GUILayout.FlexibleSpace(); EditorGUI.BeginDisabledGroup(showSetQuestStateAction && showRunLuaCodeAction && showPlaySequenceAction && showAlertAction && showSendMessagesAction && showBarkAction && showConversationAction && showSetActiveAction && showSetEnabledAction && showAnimatorStatesAction && showUnityEventAction); if (GUILayout.Button("Add Action", EditorTools.GUILayoutButtonWidth("Add Action"))) { ShowAddActionMenu(); } EditorGUI.EndDisabledGroup(); EditorGUILayout.EndHorizontal(); if (showSetQuestStateAction) { DrawQuestAction(); } if (showRunLuaCodeAction) { DrawLuaAction(); } if (showPlaySequenceAction) { DrawSequenceAction(); } if (showAlertAction) { DrawAlertAction(); } if (showSendMessagesAction) { DrawSendMessageAction(); } if (showBarkAction) { DrawBarkAction(); } if (showConversationAction) { DrawConversationAction(); } if (showSetActiveAction) { DrawSetActiveAction(); } if (showSetEnabledAction) { DrawSetEnabledAction(); } if (showAnimatorStatesAction) { DrawSetAnimatorStateAction(); } if (showUnityEventAction) { DrawUnityEventAction(); } } finally { EditorWindowTools.EditorGUILayoutEndGroup(); } } }