Example #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();
        }
Example #2
0
        public override void OnBodyGUI()
        {
            if (node == null)
            {
                node = target as MovesetAttackNode;
            }

            serializedObject.Update();

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("lastNode"));

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("attackDefinition"));

            executeList.DoLayoutList();

            inputSequence.DoLayoutList();

            // Draw GUI
            NodeEditorGUILayout.DynamicPortList(
                "nextNode",                 // field name
                typeof(nextNodeDefinition), // field type
                serializedObject,           // serializable object
                NodePort.IO.Output);        // onCreate override. This is where the magic happens.

            serializedObject.ApplyModifiedProperties();
        }
Example #3
0
        public override void OnBodyGUI()
        {
            serializedObject.Update();

            DialogueChatNode node = target as DialogueChatNode;

            EditorGUILayout.PropertyField(serializedObject.FindProperty("character"), GUIContent.none);
            if (node.answers == null || node.answers.Count == 0)
            {
                GUILayout.BeginHorizontal();
                NodeEditorGUILayout.PortField(GUIContent.none, target.GetInputPort("input"), GUILayout.MinWidth(0));
                NodeEditorGUILayout.PortField(GUIContent.none, target.GetOutputPort("output"), GUILayout.MinWidth(0));
                GUILayout.EndHorizontal();
            }
            else
            {
                NodeEditorGUILayout.PortField(GUIContent.none, target.GetInputPort("input"));
            }
            GUILayout.Space(-30);

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("content"), GUIContent.none);
            NodeEditorGUILayout.DynamicPortList("answers", typeof(DialogueBaseNode), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);

            serializedObject.ApplyModifiedProperties();
        }
        public override void OnBodyGUI()
        {
            serializedObject.Update();

            NodeEditorGUILayout.DynamicPortList("out", typeof(object), serializedObject, NodePort.IO.Input,
                                                Node.ConnectionType.Override, onCreation: _inListSetting, onAdd: x =>
            {
                _updateGetChildNodeGroup((group, node) =>
                {
                    node.AddDynamicOutput(typeof(object), Node.ConnectionType.Multiple, fieldName: x);
                });
            });

            NodeEditorGUILayout.DynamicPortList("in", typeof(object), serializedObject, NodePort.IO.Output,
                                                Node.ConnectionType.Multiple, onCreation: _outListSetting, onAdd: x =>
            {
                _updateGetChildNodeGroup((group, node) =>
                {
                    node.AddDynamicInput(typeof(object), Node.ConnectionType.Override, Node.TypeConstraint.Inherited, fieldName: x);
                });
            });

            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.LabelField(string.Empty, GUILayout.Width(GetWidth() / 2));
                NodeEditorGUILayout.PortField(new GUIContent("Main Node"), target.GetPort(ChildGroupNode.MainNodeFieldName));
            }
            EditorGUILayout.EndHorizontal();

            // Apply property modifications
            serializedObject.ApplyModifiedProperties();
        }
Example #5
0
    public override void OnBodyGUI()
    {
        NodeEditorGUILayout.PortField(new GUIContent("In"), target.GetInputPort("In"), GUILayout.MinWidth(0));
        var node = target as TalkChoiceNode;

        EditorGUILayout.LabelField("内容");
        node.content = EditorGUILayout.TextArea(node.content, GUILayout.Height(50));


        NodeEditorGUILayout.DynamicPortList("Choices", typeof(byte), serializedObject, XNode.NodePort.IO.Output);
    }
Example #6
0
        public override void OnBodyGUI()
        {
            base.OnBodyGUI();

            //NodeEditorGUILayout.PortField(target.GetInputPort("Input"), GUILayout.Width(100));
            //标题
            //NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Content"));

            //选项列表
            NodeEditorGUILayout.DynamicPortList("Chooses", typeof(DialogueChoose.Choose), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);
        }
Example #7
0
    public override void OnBodyGUI()
    {
        serializedObject.Update();

        NodeEditorGUILayout.PortField(target.GetInputPort("input"));
        NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("nick"));
        NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("content"));
        NodeEditorGUILayout.DynamicPortList("options", typeof(Object), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);
        NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("canCancel"));

        serializedObject.ApplyModifiedProperties();
    }
    public override void OnBodyGUI()
    {
        Location node = target as Location;

        NodeEditorGUILayout.PortField(GUIContent.none, target.GetInputPort("input"));
        NodeEditorGUILayout.DynamicPortList("roomLinks", typeof(Location), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);
        //Called whenever the inspector is drawn for this object.
        if (GUILayout.Button("OH GOD A BUTTON"))
        {
            //add everthing the button would do.
        }
    }
Example #9
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();
        }
Example #10
0
        public override void OnBodyGUI()
        {
            serializedObject.Update();

            GUILayout.BeginHorizontal();
            {
                NodeEditorGUILayout.PortField(new GUIContent("Prev"), target.GetInputPort("prev"), GUILayout.Width(30));

                DrawTextSupplements();
            }
            GUILayout.EndHorizontal();

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("text"), new GUIContent("Text"), false);

            NodeEditorGUILayout.DynamicPortList("selections", typeof(string), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);

            // Apply property modifications
            serializedObject.ApplyModifiedProperties();
        }
Example #11
0
        public override void OnBodyGUI()
        {
            BranchNodeBase  node  = target as BranchNodeBase;
            DialogNodeGraph graph = node.graph as DialogNodeGraph;

            NodeEditorGUILayout.PortField(new GUIContent("Last Dialog"), target.GetInputPort("LastDialog"), GUILayout.MinWidth(0));

            if (node.Branchs.Count == 0)
            {
                GUILayout.BeginHorizontal();
                NodeEditorGUILayout.PortField(new GUIContent("Next Dialog"), target.GetOutputPort("NextDialog"), GUILayout.MinWidth(0));
                GUILayout.EndHorizontal();
            }

            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("DialogueName"), new GUIContent("Dialogue Name"));
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("canReturn"), new GUIContent("Can Return"));

            GUILayout.Space(5);

            NodeEditorGUILayout.DynamicPortList("Branchs", typeof(DialogBaseNode), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);
        }
Example #12
0
        public override void OnBodyGUI()
        {
            //base.OnBodyGUI();
            var choose = target as DialogueChoose;

            GUILayout.BeginHorizontal();

            //输入------

            NodeEditorGUILayout.PortField(target.GetInputPort("Input"), GUILayout.Width(100));


            EditorGUILayout.Space();

            GUILayout.EndHorizontal();

            //标题
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Title"));
            //询问者
            NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("Speaker"));

            //选项列表
            NodeEditorGUILayout.DynamicPortList("ChooseList", typeof(DialogueChoose.S_Choose), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);
        }
Example #13
0
        public override void OnBodyGUI()
        {
            this.DrawParentPort();
            this.ProcessParentPort();

            NodeEditorGUILayout.DynamicPortList("children", typeof(Task), this.serializedObject, NodePort.IO.Output, Node.ConnectionType.Override, Node.TypeConstraint.Strict, OnCreateReorderableList);

            var branch = this.target as Branch;
            int index  = 0;

            foreach (var nodePort in this.target.DynamicOutputs)
            {
                if (nodePort.Connection == null)
                {
                    branch.children[index] = null;
                }
                else
                {
                    branch.children[index] = nodePort.Connection.node as Task;
                }

                index++;
            }
        }
        public override void OnBodyGUI()
        {
            if (_lastWindow != NodeEditorWindow.current)
            {
                _lastWindow = NodeEditorWindow.current;

                _updatePort();
            }
            serializedObject.Update();
            {
                EditorGUI.BeginChangeCheck();
                {
                    if (_groupSer == null)
                    {
                        _groupSer = serializedObject.FindProperty(GetChildGroupNode.GroupFieldName);
                    }

                    NodeEditorGUILayout.PropertyField(_groupSer, new GUIContent("Group"));
                    _currentGroup = (IcSkillGroup)_groupSer.objectReferenceValue;
                }
                if (EditorGUI.EndChangeCheck())
                {
                    _updatePort();
                }

                NodeEditorGUILayout.DynamicPortList("in", typeof(object), serializedObject, NodePort.IO.Input,
                                                    Node.ConnectionType.Override, onCreation: _listSettingInput);

                NodeEditorGUILayout.DynamicPortList("out", typeof(object), serializedObject, NodePort.IO.Output,
                                                    Node.ConnectionType.Multiple, onCreation: _listSettingOutput);

                NodeEditorGUILayout.PortField(new GUIContent("Group Root"), target.GetPort(nameof(GetChildGroupNode.OutValue)));
            }
            // Apply property modifications
            serializedObject.ApplyModifiedProperties();
        }
Example #15
0
        public override void OnBodyGUI()
        {
            if (chatNode == null)
            {
                chatNode = target as ChatNode;
            }



            // Debug.Log("操作chatnode中");
            // serializedObject.Update();
            // base.OnBodyGUI();
            // NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("ChatNodeID"));
            foreach (XNode.NodePort Port in target.Ports)
            {
                if (NodeEditorGUILayout.IsDynamicPortListPort(Port))
                {
                    continue;
                }
                NodeEditorGUILayout.PortField(Port);
            }

            //对对话列表进行序列化
            bool forceReset = false;

            //Debug.Log("我是最优先的吗");
            if (chatNode.lastIsMax != chatNode.IsMax)
            {
                forceReset         = true;
                chatNode.lastIsMax = chatNode.IsMax;
            }

            //姓名元素重载判定
            if (tAsset != null)
            {
                tAsset = dialogueGraph.GetAsset();
                bool isNameEqual = true;
                if (chatNode.tPersonNameList.Count == tAsset.persons.Count)
                {
                    for (int i = 0; i < tAsset.persons.Count; i++)
                    {
                        if (chatNode.tPersonNameList[i] != tAsset.persons[i].Name)
                        {
                            isNameEqual = false;
                            chatNode.tPersonNameList[i] = tAsset.persons[i].Name;
                        }
                    }

                    if (!isNameEqual)
                    {
                        forceReset = true;
                    }
                }
                else
                {
                    chatNode.tPersonNameList.Clear();

                    forceReset = true;
                }
            }

            if (chatNode.IsMax)
            {
                //  Debug.Log("重复渲染节点");
                NodeEditorGUILayout.DynamicPortList("chatslist", typeof(SingleChatClass), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override, Node.TypeConstraint.None, DrawList, forceReset);



                if (GUILayout.Button("Minimize", EditorStyles.miniButton))
                {
                    chatNode.IsMax = false;
                }

                //serializedObject.ApplyModifiedProperties();
            }
            else
            {
                NodeEditorGUILayout.DynamicPortList("chatslist", typeof(SingleChatClass), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override, Node.TypeConstraint.None, SimpleDrawList, forceReset);
                if (GUILayout.Button("Maximize", EditorStyles.miniButton))
                {
                    chatNode.IsMax = true;
                }
            }

            #region Old
            //GUI.color = Color.white;
            //serializedObject.Update();
            //if (chatNode == null)
            //chatNode = target as ChatNode;

            //foreach (XNode.NodePort dynamicPort in target.DynamicPorts)
            //{
            //    if (NodeEditorGUILayout.IsDynamicPortListPort(dynamicPort)) continue;
            //    NodeEditorGUILayout.PortField(dynamicPort);
            //}
            //NodeEditorGUILayout.DynamicPortList("chatslist", typeof(SingleChatClass), serializedObject, NodePort.IO.Output, Node.ConnectionType.Override);
            ////  NodeEditorGUILayout.PortField(Port);

            //NodeEditorGUILayout.PropertyField(serializedObject.FindProperty("chatslist"));

            //aaa.DoLayoutList();
            //serializedObject.ApplyModifiedProperties();
            //base.OnBodyGUI();
            #endregion
        }