private void AddReply()
    {
        rect.height += textHeight + padding;
        DialogueReply reply = new DialogueReply();

        nodeData.replies.Add(reply);
        replies.Add(new GUIDialogueReply(reply, this, replies.Count, replies.Count));
    }
 public GUIDialogueReply(DialogueReply data, GUIDialogueNode parent, int replyID, int verticalPos = -1)
 {
     replyData    = data;
     this.replyID = replyID;
     this.parent  = parent;
     outPoint     = new ConnectionPoint(parent, ConnectionPointType.Out, this, verticalPos);
     if (verticalPos != -1)
     {
         UpdateVerticalPos(verticalPos);
     }
 }
    public GUIDialogueNode(DialogueEditor parentEditor, DialogueNode data)
    {
        this.nodeData   = data;
        this.speakerUID = parentEditor.speakerUID;
        this.editor     = parentEditor;
        this.replies    = new List <GUIDialogueReply>();
        if (nodeData.replies.Count == 0)
        {
            nodeData.replies.Add(new DialogueReply());
        }
        for (int i = 0; i < data.replies.Count; i++)
        {
            DialogueReply replyData = data.replies[i];
            this.replies.Add(new GUIDialogueReply(replyData, this, i, i));
        }
        repliesToRemove = new List <GUIDialogueReply>();

        isInitialLine = (parentEditor.initialLineID == this.lineID);
        nameLabelRect = new Rect(
            data.position.x + padding, data.position.y + padding,
            textWidth, nameHeight
            );
        nameRect = new Rect(
            data.position.x + padding, data.position.y + padding + nameHeight,
            textWidth, nameHeight
            );
        initialLineToggleRect = new Rect(
            data.position.x + padding, data.position.y + padding + nameHeight * 2.0f,
            textWidth, nameHeight
            );
        textLabelRect = new Rect(
            data.position.x + padding, data.position.y + padding + nameHeight * 3.0f,
            textWidth, textHeight
            );
        textRect = new Rect(
            data.position.x + padding, data.position.y + padding * 2.0f + nameHeight * 4.0f,
            textWidth, textHeight
            );
        rect = new Rect(
            data.position.x, data.position.y,
            textWidth + padding * 2.0f, mainBlockHeight + (textHeight + padding) * replies.Count
            );

        style = defaultNodeStyle;

        inPoint = new ConnectionPoint(this, ConnectionPointType.In);
    }