Пример #1
0
        /// <inheritdoc />
        public override void OnBodyGUI()
        {
            SOFlowEditorUtilities.AdjustTextContrast(GetTint());

            serializedObject.Update();

            BranchNode branch = (BranchNode)target;

            NodePort entryPort   = GetDynamicPort("Entry", true, Node.ConnectionType.Multiple);
            NodePort defaultPort = GetDynamicPort("Default", false);

            SOFlowEditorUtilities.DrawHorizontalColourLayer(SOFlowEditorSettings.TertiaryLayerColour,
                                                            () =>
            {
                NodeEditorGUILayout.PortField(entryPort);
            });

            SOFlowEditorUtilities.RestoreTextContrast();

            NodeEditorGUILayout.DynamicPortList(nameof(branch.Conditions), typeof(Node), serializedObject,
                                                NodePort.IO.Output, Node.ConnectionType.Override);

            SOFlowEditorUtilities.DrawHorizontalColourLayer(SOFlowEditorSettings.TertiaryLayerColour,
                                                            () =>
            {
                NodeEditorGUILayout.PortField(defaultPort);
            });

            serializedObject.ApplyModifiedProperties();
        }
Пример #2
0
        /// <inheritdoc />
        public override void OnBodyGUI()
        {
            SOFlowEditorUtilities.AdjustTextContrast(GetTint());

            serializedObject.Update();

            EventNode eventNode = (EventNode)target;

            NodePort entryPort = GetDynamicPort("Entry", true, Node.ConnectionType.Multiple);
            NodePort exitPort  = GetDynamicPort("Exit", false);

            SOFlowEditorUtilities.DrawHorizontalColourLayer(SOFlowEditorSettings.TertiaryLayerColour,
                                                            () =>
            {
                NodeEditorGUILayout.PortField(entryPort,
                                              GUILayout.MinWidth(0f));

                NodeEditorGUILayout.PortField(exitPort,
                                              GUILayout.MinWidth(0f));
            });

            SOFlowEditorUtilities.RestoreTextContrast();

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(eventNode.Event)));

            serializedObject.ApplyModifiedProperties();
        }
Пример #3
0
        public override void OnBodyGUI()
        {
            SOFlowEditorUtilities.AdjustTextContrast(SOFlowEditorSettings.AcceptContextColour);

            base.OnBodyGUI();

            SOFlowEditorUtilities.RestoreTextContrast();
        }
Пример #4
0
        /// <inheritdoc />
        public override void OnBodyGUI()
        {
            SOFlowEditorUtilities.AdjustTextContrast(GetTint());

            base.OnBodyGUI();

            SOFlowEditorUtilities.RestoreTextContrast();
        }
Пример #5
0
        /// <inheritdoc />
        public override void OnBodyGUI()
        {
            SOFlowEditorUtilities.AdjustTextContrast(GetTint());

            serializedObject.Update();

            DialogNode dialog = (DialogNode)target;

            NodePort entryPort = GetDynamicPort("Entry", true, Node.ConnectionType.Multiple);
            NodePort exitPort  = GetDynamicPort("Exit", false);

            if (dialog.Choices.Count == 0)
            {
                SOFlowEditorUtilities.DrawHorizontalColourLayer(SOFlowEditorSettings.SecondaryLayerColour,
                                                                () =>
                {
                    NodeEditorGUILayout.PortField(entryPort,
                                                  GUILayout.MinWidth(0f));

                    NodeEditorGUILayout.PortField(exitPort,
                                                  GUILayout.MinWidth(0f));
                });
            }
            else
            {
                SOFlowEditorUtilities.DrawHorizontalColourLayer(SOFlowEditorSettings.SecondaryLayerColour,
                                                                () =>
                {
                    NodeEditorGUILayout.PortField(entryPort);
                });
            }

            string value = dialog.Dialog.Value;

            if (value == null)
            {
                EditorGUILayout.LabelField("Data unassigned.");
            }
            else
            {
                dialog.Dialog.Value =
                    EditorGUILayout.TextArea(value, GUILayout.MinHeight(EditorGUIUtility.singleLineHeight * 3f));
            }

            SOFlowEditorUtilities.RestoreTextContrast();

            NodeEditorGUILayout.DynamicPortList(nameof(dialog.Choices), typeof(Node), serializedObject,
                                                NodePort.IO.Output, Node.ConnectionType.Override);

            serializedObject.ApplyModifiedProperties();
        }