public void BindConnection(NextNode next, PreNode prev, ConnectionDef def)
        {
            if (prev == null || next == null)
            {
                return;
            }
            for (int i = 0; i < connections.Count; ++i)
            {
                Connection connection = connections[i];

                if (connection.outId == next.parent.id &&
                    connection.inId == prev.parent.id &&
                    connection.outIdx == next.outIdx &&
                    connection.inIndex == prev.inIdx
                    )
                {
                    UnBindConnection(next, prev, connection);
                    return;
                }
            }

            if (prev.connectDef != next.connectDef)
            {
                UnityEngine.Debug.LogError("接口类型不同!");
                return;
            }

            if (prev.connectDef.multiInput == false)
            {
                if (prev.GetPortCount() >= 1)
                {
                    UnityEngine.Debug.LogError("入口连线数不能超过1");
                    return;
                }
            }

            if (next.connectDef.multiInput == false)
            {
                if (next.GetPortCount() >= 1)
                {
                    UnityEngine.Debug.LogError("出口连线数不能超过1");
                    return;
                }
            }

            Connection newConnect = new Connection();

            newConnect.connectDef = def;
            newConnect.connectDef.Init(newConnect);
            newConnect.outId   = next.parent.id;
            newConnect.outIdx  = next.outIdx;
            newConnect.outName = next.name;
            newConnect.inId    = prev.parent.id;
            newConnect.inIndex = prev.inIdx;
            newConnect.inName  = prev.name;
            AddConnection(newConnect);

            prev.AddPort(next.parent.id, next.outIdx);
            next.AddPort(prev.parent.id, prev.inIdx);
        }