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(); } } }
protected virtual void DrawTopInfo() { // Trigger event: triggerProperty = serializedObject.FindProperty("trigger"); EditorGUILayout.PropertyField(triggerProperty, true); // HelpBox for OnTrigger/Collision: var isPhysicsEvent = triggerProperty.enumValueIndex == 3 || //DialogueSystemTriggerEvent.OnTriggerEnter triggerProperty.enumValueIndex == 7 || //DialogueSystemTriggerEvent.OnTriggerExit triggerProperty.enumValueIndex == 11 || //DialogueSystemTriggerEvent.OnCollisionEnter triggerProperty.enumValueIndex == 12; //DialogueSystemTriggerEvent.OnCollisionExit if (isPhysicsEvent) { var acceptedTags = serializedObject.FindProperty("condition").FindPropertyRelative("acceptedTags"); if (acceptedTags.arraySize == 0) { EditorGUILayout.HelpBox("You may want to set Conditions > Accepted Tags to observe collisions only with GameObjects with specific tags such as 'Player'. Otherwise this trigger may fire for unintended collisions such as world geometry.", MessageType.Info); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Add 'Player' Tag", EditorStyles.miniButton, EditorTools.GUILayoutButtonWidth("Add 'Player' Tag"))) { acceptedTags.arraySize = 1; acceptedTags.GetArrayElementAtIndex(0).stringValue = "Player"; } EditorGUILayout.EndHorizontal(); } } // Reference database: var databaseProperty = serializedObject.FindProperty("selectedDatabase"); var oldDatabase = databaseProperty.objectReferenceValue; EditorGUILayout.PropertyField(databaseProperty, new GUIContent("Reference Database", "Database to use for pop-up menus. Assumes this database will be in memory at runtime."), true); var newDatabase = databaseProperty.objectReferenceValue as DialogueDatabase; if (newDatabase != oldDatabase) { luaScriptWizard = new LuaScriptWizard(newDatabase); questPicker = new QuestPicker(newDatabase, trigger.questName, trigger.useQuestNamePicker); questPicker.showReferenceDatabase = false; } if (newDatabase != null) { EditorTools.selectedDatabase = newDatabase; } }