public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EditorWindowTools.DrawDeprecatedTriggerHelpBox();
            var trigger = target as ConversationTrigger;

            if (trigger == null)
            {
                return;
            }
            EditorGUILayout.PropertyField(serializedObject.FindProperty("trigger"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("conversation"), true);
            var dbProperty = serializedObject.FindProperty("selectedDatabase");

            if (dbProperty.objectReferenceValue != EditorTools.selectedDatabase)
            {
                dbProperty.objectReferenceValue = EditorTools.selectedDatabase;
            }
            EditorGUILayout.PropertyField(serializedObject.FindProperty("actor"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("conversant"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("once"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("exclusive"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("skipIfNoValidEntries"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("stopConversationOnTriggerExit"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("condition"), true);
            serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EditorWindowTools.DrawDeprecatedTriggerHelpBox();
            var trigger = target as SequenceTrigger;

            if (trigger == null)
            {
                return;
            }
            var triggerProperty = serializedObject.FindProperty("trigger");

            EditorGUILayout.PropertyField(triggerProperty);
            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"));
            }
            serializedObject.ApplyModifiedProperties();
            EditorGUI.BeginChangeCheck();
            var newSequence = SequenceEditorTools.DrawLayout(new GUIContent("Sequence"), trigger.sequence, ref sequenceRect, ref syntaxState);
            var changed     = EditorGUI.EndChangeCheck();

            serializedObject.Update();
            if (changed)
            {
                serializedObject.FindProperty("sequence").stringValue = newSequence;
            }

            EditorGUILayout.PropertyField(serializedObject.FindProperty("speaker"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("listener"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("once"), true);
            EditorTools.DrawReferenceDatabase();
            EditorGUILayout.PropertyField(serializedObject.FindProperty("condition"), true);
            serializedObject.ApplyModifiedProperties();
        }
Beispiel #3
0
 public override void OnInspectorGUI()
 {
     EditorTools.DrawReferenceDatabase();
     if (isDeprecated)
     {
         EditorWindowTools.DrawDeprecatedTriggerHelpBox();
     }
     DrawDefaultInspector();
 }
Beispiel #4
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorWindowTools.DrawDeprecatedTriggerHelpBox();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("trigger"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("selectedDatabase"), new GUIContent("Reference Database"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("barkOrder"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("once"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("onStart"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("onEnd"), true);
     serializedObject.ApplyModifiedProperties();
 }
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorWindowTools.DrawDeprecatedTriggerHelpBox();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("trigger"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("localizedTextTable"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("message"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("duration"), true);
     EditorGUILayout.PropertyField(serializedObject.FindProperty("once"), true);
     EditorTools.DrawReferenceDatabase();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("condition"), true);
     serializedObject.ApplyModifiedProperties();
 }
Beispiel #6
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EditorWindowTools.DrawDeprecatedTriggerHelpBox();
            var trigger = target as BarkTrigger;

            if (trigger == null)
            {
                return;
            }
            EditorGUILayout.PropertyField(serializedObject.FindProperty("trigger"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("conversation"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("barkOrder"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("conversant"), new GUIContent("Barker", "The actor speaking the bark. If unassigned, this GameObject."), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("target"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("once"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("skipIfNoValidEntries"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("allowDuringConversations"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("cacheBarkLines"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("condition"), true);
            serializedObject.ApplyModifiedProperties();
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            EditorWindowTools.DrawDeprecatedTriggerHelpBox();
            var trigger = target as LuaTrigger;

            if (trigger == null || luaScriptWizard == null)
            {
                return;
            }
            EditorGUILayout.PropertyField(serializedObject.FindProperty("trigger"), true);

            var newDatabase = EditorGUILayout.ObjectField("Reference Database", luaScriptWizard.database, typeof(DialogueDatabase), false) as DialogueDatabase;

            if (newDatabase != luaScriptWizard.database)
            {
                EditorTools.selectedDatabase = newDatabase;
                luaScriptWizard.database     = newDatabase;
                luaScriptWizard.RefreshWizardResources();
            }

            // Lua code / wizard:
            serializedObject.ApplyModifiedProperties();
            EditorGUI.BeginChangeCheck();
            var newLuaCode = luaScriptWizard.Draw(new GUIContent("Lua Code", "The Lua code to run."), trigger.luaCode);
            var changed    = EditorGUI.EndChangeCheck();

            serializedObject.Update();
            if (changed)
            {
                serializedObject.FindProperty("luaCode").stringValue = newLuaCode;
            }

            EditorGUILayout.PropertyField(serializedObject.FindProperty("once"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("condition"), true);
            serializedObject.ApplyModifiedProperties();
        }
Beispiel #8
0
        public override void OnInspectorGUI()
        {
            var trigger = target as QuestTrigger;

            if (trigger == null)
            {
                return;
            }

            serializedObject.Update();
            EditorWindowTools.DrawDeprecatedTriggerHelpBox();
            EditorGUILayout.PropertyField(serializedObject.FindProperty("trigger"), true);

            // Quest picker:
            if (questPicker != null)
            {
                serializedObject.ApplyModifiedProperties();
                questPicker.Draw();
                trigger.questName          = questPicker.currentQuest;
                trigger.useQuestNamePicker = questPicker.usePicker;
                trigger.selectedDatabase   = questPicker.database;
                serializedObject.Update();
            }

            if (trigger.selectedDatabase != null)
            {
                EditorTools.selectedDatabase = trigger.selectedDatabase;
            }
            if (EditorTools.selectedDatabase == null)
            {
                EditorTools.selectedDatabase = EditorTools.FindInitialDatabase();
            }

            // Quest state
            var setQuestStateProperty = serializedObject.FindProperty("setQuestState");

            EditorGUILayout.PropertyField(setQuestStateProperty, true);
            if (setQuestStateProperty.boolValue)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("questState"), true);
            }

            // Quest entry state:
            var setQuestEntryStateProperty = serializedObject.FindProperty("setQuestEntryState");

            EditorGUILayout.PropertyField(setQuestEntryStateProperty, true);
            if (setQuestEntryStateProperty.boolValue)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("questEntryNumber"), true);
                EditorGUILayout.PropertyField(serializedObject.FindProperty("questEntryState"), true);
            }

            // Lua code / wizard:
            if (EditorTools.selectedDatabase != luaScriptWizard.database)
            {
                luaScriptWizard.database = EditorTools.selectedDatabase;
                luaScriptWizard.RefreshWizardResources();
            }
            serializedObject.ApplyModifiedProperties();
            trigger.luaCode = luaScriptWizard.Draw(new GUIContent("Lua Code", "The Lua code to run when the condition is true"), trigger.luaCode);

            serializedObject.Update();

            // Alert:
            EditorGUILayout.PropertyField(serializedObject.FindProperty("alertMessage"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("localizedTextTable"), true);

            // Send Messages list:
            EditorGUILayout.PropertyField(serializedObject.FindProperty("sendMessages"), true);

            EditorGUILayout.PropertyField(serializedObject.FindProperty("once"), true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("condition"), true);
            serializedObject.ApplyModifiedProperties();
        }