private PathfindingDebugTextElement CreatNewTextElement()
    {
        PathfindingDebugTextElement newInstance = GameObject.Instantiate(textElementPrefab);

        newInstance.transform.SetParent(uiParent);
        instantiatedElements.Add(newInstance);

        return(newInstance);
    }
    private void UpdateText()
    {
        shouldUpdateText = false;

        ResetElements();

        foreach (PathEntry entry in entries)
        {
            foreach (var nodeData in entry.Nodes.Values)
            {
                PathfindingDebugTextElement textElement = GetElement();
                textElement.gameObject.SetActive(true);
                textElement.Initialize(nodeData.node);
            }
        }
    }