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();
        }
Exemple #2
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("target"), true);
     EditorTools.DrawReferenceDatabase();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("condition"), true);
     serializedObject.ApplyModifiedProperties();
 }
Exemple #3
0
 public override void OnInspectorGUI()
 {
     EditorTools.DrawReferenceDatabase();
     if (isDeprecated)
     {
         EditorWindowTools.DrawDeprecatedTriggerHelpBox();
     }
     DrawDefaultInspector();
 }
 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();
 }
        public override void OnInspectorGUI()
        {
            var persistentActiveData = target as PersistentActiveData;

            if (persistentActiveData == null)
            {
                return;
            }

            persistentActiveData.target = EditorGUILayout.ObjectField(new GUIContent("Target", "The GameObject to set active or inactive based on the Condition below"), persistentActiveData.target, typeof(GameObject), true) as GameObject;

            EditorTools.DrawReferenceDatabase();
            EditorTools.DrawSerializedProperty(serializedObject, "condition");
        }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (string.IsNullOrEmpty(currentLuaWizardContent))
            {
                currentLuaWizardContent = property.stringValue;
            }

            EditorGUI.BeginProperty(position, label, property);
            try
            {
                EditorTools.SetInitialDatabaseIfNull();
                try
                {
                    if (ShowReferenceDatabase())
                    {
                        EditorTools.DrawReferenceDatabase(new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight));
                        position = new Rect(position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, position.height - EditorGUIUtility.singleLineHeight);
                    }
                    luaWizard.database = EditorTools.selectedDatabase;
                    if (luaWizard.database == null)
                    {
                        EditorGUI.PropertyField(position, property);
                    }
                    else
                    {
                        if (!luaWizard.IsOpen)
                        {
                            luaWizard.OpenWizard(currentLuaWizardContent);
                        }
                        lastComputedHeight      = luaWizard.GetHeight() + GUI.skin.textArea.CalcHeight(new GUIContent(currentLuaWizardContent), position.width);
                        currentLuaWizardContent = luaWizard.Draw(position, label, currentLuaWizardContent);
                        property.stringValue    = currentLuaWizardContent;
                        if (!luaWizard.IsOpen && !string.IsNullOrEmpty(currentLuaWizardContent))
                        {
                            property.stringValue = currentLuaWizardContent;
                            luaWizard.OpenWizard(currentLuaWizardContent);
                        }
                    }
                }
                catch (System.Exception)
                {
                    // Don't cause editor problems if Lua wizard has problems.
                }
            }
            finally
            {
                EditorGUI.EndProperty();
            }
        }
        public override void OnInspectorGUI()
        {
            var trigger = target as AlertTrigger;

            if (trigger == null)
            {
                return;
            }

            trigger.trigger            = (DialogueTriggerEvent)EditorGUILayout.EnumPopup(new GUIContent("Trigger", "The event that triggers the Lua code"), trigger.trigger);
            trigger.localizedTextTable = EditorGUILayout.ObjectField(new GUIContent("Localized Text Table", "Optional localized text table; if assigned, Message is the field in the table"), trigger.localizedTextTable, typeof(LocalizedTextTable), true) as LocalizedTextTable;
            trigger.message            = EditorGUILayout.TextField(new GUIContent("Message", "The message to display, which may contain tags such as [var=varName]"), trigger.message);
            trigger.duration           = EditorGUILayout.FloatField(new GUIContent("Duration", "The duration in seconds to display the message"), trigger.duration);
            trigger.once = EditorGUILayout.Toggle(new GUIContent("Only Once", "Only trigger once, then destroy this component"), trigger.once);

            EditorTools.DrawReferenceDatabase();
            EditorTools.DrawSerializedProperty(serializedObject, "condition");
        }
        public override void OnInspectorGUI()
        {
            var trigger = target as SequenceTrigger;

            if (trigger == null)
            {
                return;
            }

            trigger.trigger = (DialogueTriggerEvent)EditorGUILayout.EnumPopup(new GUIContent("Trigger", "The event that triggers the sequence"), trigger.trigger);
            if (trigger.trigger == DialogueTriggerEvent.OnEnable || trigger.trigger == DialogueTriggerEvent.OnStart)
            {
                trigger.waitOneFrameOnStartOrEnable = EditorGUILayout.Toggle(new GUIContent("Wait 1 Frame", "Tick to wait one frame to allow other components to finish their OnStart/OnEnable"), trigger.waitOneFrameOnStartOrEnable);
            }
            EditorGUILayout.LabelField(new GUIContent("Sequence", "The sequence to play"));
            EditorWindowTools.StartIndentedSection();
            trigger.sequence = EditorGUILayout.TextArea(trigger.sequence);
            EditorWindowTools.EndIndentedSection();
            trigger.speaker  = EditorGUILayout.ObjectField(new GUIContent("Speaker", "The GameObject referenced by 'speaker'. If unassigned, this GameObject"), trigger.speaker, typeof(Transform), true) as Transform;
            trigger.listener = EditorGUILayout.ObjectField(new GUIContent("Listener", "The GameObject referenced by 'listener'. If unassigned, the GameObject that triggered this sequence"), trigger.listener, typeof(Transform), true) as Transform;
            trigger.once     = EditorGUILayout.Toggle(new GUIContent("Only Once", "Only trigger once, then destroy this component"), trigger.once);
            EditorTools.DrawReferenceDatabase();
            EditorTools.DrawSerializedProperty(serializedObject, "condition");
        }
 public override void OnInspectorGUI()
 {
     EditorTools.DrawReferenceDatabase();
     DrawDefaultInspector();
 }