private void CompleteConnection()
        {
            if (!startConnection.AllowsMultipleConnections())
            {
                startConnection.RemoveAllConnections();
            }

            if (!endConnection.AllowsMultipleConnections())
            {
                endConnection.RemoveAllConnections();
            }

            startConnection.MakeNewConnectionTo(endConnection);
            endConnection.MakeNewConnectionTo(startConnection);


            startConnection.isCreatingNewConnection = false;
            endConnection   = null;
            startConnection = null;
            save            = true;
        }
        private void CreateNewBranchConnectedTo(ConnectionPoint connected)
        {
            if (!connected.AllowsMultipleConnections())
            {
                connected.RemoveAllConnections();
            }

            var newNode = ScenimaticScriptEditor.CreateNewBranch(savedMousePos);

            AddBranch(newNode);

            if (connected.connectionDirection == ConnectionPointDirection.Out)
            {
                newNode.data.connectionInputs[0].connectedToGUIDs.Add(connected.GUID);
                connected.connection.connectedToGUIDs.Add(newNode.data.connectionInputs[0].GUID);
            }
            else
            {
                newNode.data.connectionOutputs[0].connectedToGUIDs.Add(connected.GUID);
                connected.connection.connectedToGUIDs.Add(newNode.data.connectionOutputs[0].GUID);
            }
        }
        private void CreateNewConnectionPointFromConnection(GraphEntityData graphEntity, ConnectionPoint connectedTo, ConnectionPointDirection direction)
        {
            Connection newConn = new Connection()
            {
                type         = connectedTo.connection.type,
                GUID         = System.Guid.NewGuid().ToString(),
                variableName = connectedTo.connection.variableName,
            };

            ScenimaticBranchEditor.CheckForDuplicateNameInConnections(newConn, graphEntity.GetConnections(direction));
            graphEntity.AddNewConnectionPoint(newConn, direction);

            if (!connectedTo.AllowsMultipleConnections())
            {
                connectedTo.RemoveAllConnections();
            }

            newConn.connectedToGUIDs.Add(connectedTo.GUID);
            connectedTo.connection.connectedToGUIDs.Add(newConn.GUID);

            RefreshConnectionPoint(connectedTo);
        }