// Version for Archetypes attached to heroes
    private ArchetypeUITreeNode CreateTreeNode(ArchetypeSkillNode node, HashSet <ArchetypeSkillNode> traversedNodes,
                                               HeroArchetypeData archetype, UILineRenderer parent, Dictionary <ArchetypeSkillNode, ArchetypeUITreeNode> nodeDict)
    {
        if (node == null)
        {
            return(null);
        }

        ArchetypeUITreeNode currentNode;

        // Check if node has been traversed yet
        // if already created, just return the node
        if (traversedNodes.Add(node))
        {
            currentNode = Instantiate(nodePrefab, parent.transform);
            currentNode.SetNode(node, archetype, false);
            nodeDict.Add(node, currentNode);
            if (Math.Abs(node.nodePosition.x) > largestX)
            {
                largestX = Math.Abs(node.nodePosition.x);
            }
            if (Math.Abs(node.nodePosition.y) > largestY)
            {
                largestY = Math.Abs(node.nodePosition.y);
            }
        }
        else
        {
            return(nodeDict[node]);
        }

        int currentNodeLevel = archetype.GetNodeLevel(node);

        foreach (int x in node.children)
        {
            ArchetypeSkillNode  n     = archetype.Base.GetNode(x);
            ArchetypeUITreeNode child = CreateTreeNode(n, traversedNodes, archetype, parent, nodeDict);

            Color color          = Color.black;
            int   childNodeLevel = archetype.GetNodeLevel(n);
            if (currentNodeLevel > 0 && childNodeLevel > 0)
            {
                color = ArchetypeUITreeNode.CONNECTED_COLOR;
            }
            else if (currentNodeLevel > 0 || childNodeLevel > 0)
            {
                color = ArchetypeUITreeNode.AVAILABLE_COLOR;
            }

            UILineRenderer.LinePoint point = new UILineRenderer.LinePoint(currentNode.transform.localPosition + LineOffsetY, child.transform.localPosition + LineOffsetY, color);
            currentNode.connectedNodes.Add(child, point);
            child.connectedNodes.Add(currentNode, point);
            parent.AddPoints(point);
        }

        return(currentNode);
    }
    // Version for archetype items
    private ArchetypeUITreeNode CreateTreeNode(ArchetypeSkillNode node, HashSet <ArchetypeSkillNode> traversedNodes,
                                               ArchetypeBase archetypeBase, UILineRenderer parent, Dictionary <ArchetypeSkillNode, ArchetypeUITreeNode> nodeDict)
    {
        if (node == null)
        {
            return(null);
        }

        ArchetypeUITreeNode currentNode;

        // Check if node has been traversed yet
        // if already created, just return the node
        if (traversedNodes.Add(node))
        {
            currentNode = Instantiate(nodePrefab, parent.transform);
            currentNode.SetNode(node, null, true);
            nodeDict.Add(node, currentNode);
            if (Math.Abs(node.nodePosition.x) > largestX)
            {
                largestX = Math.Abs(node.nodePosition.x);
            }
            if (Math.Abs(node.nodePosition.y) > largestY)
            {
                largestY = Math.Abs(node.nodePosition.y);
            }
        }
        else
        {
            return(nodeDict[node]);
        }

        foreach (int x in node.children)
        {
            ArchetypeSkillNode  n     = archetypeBase.GetNode(x);
            ArchetypeUITreeNode child = CreateTreeNode(n, traversedNodes, archetypeBase, parent, nodeDict);
            currentNode.connectedNodes.Add(child, null);
            child.connectedNodes.Add(currentNode, null);
            UILineRenderer.LinePoint point = new UILineRenderer.LinePoint(currentNode.transform.localPosition + LineOffsetY, child.transform.localPosition + LineOffsetY, Color.black);
            parent.AddPoints(point);
        }

        return(currentNode);
    }