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 #2
0
        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();
                }
            }
        }
Beispiel #3
0
        private DialogueTriggerEvent DrawTriggerPopup(DialogueTriggerEvent trigger)
        {
            //---Was: DialogueTriggerEvent result = (DialogueTriggerEvent) EditorGUILayout.EnumPopup("Trigger", trigger);
            var result = DialogueTriggerEventDrawer.LayoutPopup("Trigger", trigger);

            EditorGUILayout.HelpBox(GetDialogueTriggerDescription(trigger), MessageType.None);
            return(result);
        }