public override void OnAfterDeserialize()
        {
            base.OnAfterDeserialize();
            if (HasDeserializeError)
            {
                return;
            }

            member = null;
            Type type = null;

            if (!string.IsNullOrEmpty(typeName))
            {
                type = FlowNodeData.FindType(typeName);
            }
            if (type == null)
            {
                SetDeserializeError("not found type. type:" + typeName);
                return;
            }
            if (!string.IsNullOrEmpty(memberName))
            {
                member = GetMember(type, memberName);
            }
            if (member == null)
            {
                SetDeserializeError("not found member. field:" + memberName);
                return;
            }
            ResetPorts();
        }
        public void RemoveNode(FlowNodeData node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            if (!nodes.Contains(node))
            {
                return;
            }
            if (node.Node != null)
            {
                foreach (var flowOutput in node.Node.FlowOutputs)
                {
                    if (flowOutput.LinkInput != null)
                    {
                        BreakFlowPort(flowOutput);
                    }
                }

                foreach (var input in node.Node.ValueInputs)
                {
                    if (input.LinkOutput != null)
                    {
                        BreakValuePort(input);
                    }
                }

                foreach (var n in nodes)
                {
                    if (n.Node == null || n == node)
                    {
                        continue;
                    }

                    foreach (var output in n.Node.FlowOutputs)
                    {
                        if (output.LinkInput != null && output.LinkInput.Node == node.Node)
                        {
                            BreakFlowPort(output);
                        }
                    }

                    foreach (var input in n.Node.ValueInputs)
                    {
                        if (input.LinkOutput != null && input.LinkOutput.Node == node.Node)
                        {
                            BreakValuePort(input);
                        }
                    }
                }
            }
            nodes.Remove(node);
        }
        public FlowNodeData AddNode(FlowAsset node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            var nodeData = new FlowNodeData(node);

            nodes.Add(nodeData);
            return(nodeData);
        }
        public FlowNodeData AddNode(FlowNode node, Vector2 position)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            FlowNodeData n = Exists(node);

            if (n == null)
            {
                n = new FlowNodeData(node);
                n.OnBeforeSerialize();
            }

            n.Position = position;
            nodes.Add(n);
            return(n);
        }