public void Update()
        {
            if (reset)
            {
                donePath = false;
                ArrayFunc.Clear(ref solvedPath);
                reset = false;
            }

            if (start == null || end == null)
            {
                Debug.LogWarning("Need 'start' and or 'end' defined!");
                enabled = false;
                return;
            }

            startIndex = Closest(sources, start.transform.position);

            endIndex = Closest(sources, end.transform.position);


            if (startIndex != lastStartIndex || endIndex != lastEndIndex)
            {
                reset          = true;
                lastStartIndex = startIndex;
                lastEndIndex   = endIndex;
                return;
            }

            for (int i = 0; i < sources.Count; i++)
            {
                if (AStarHelper.Invalid(sources[i]))
                {
                    continue;
                }
                sources[i].nodeColor = nodeColor;
            }

            PulsePoint(lastStartIndex);
            PulsePoint(lastEndIndex);


            if (!donePath)
            {
                solvedPath = AStarHelper.Calculate(sources[lastStartIndex], sources[lastEndIndex]);

                donePath = true;
            }

            // Invalid path
            if (solvedPath == null || solvedPath.Count < 1)
            {
                Debug.LogWarning("Invalid path!");
                reset   = true;
                enabled = false;
                return;
            }


            //Draw path
            for (int i = 0; i < solvedPath.Count - 1; i++)
            {
                if (AStarHelper.Invalid(solvedPath[i]) || AStarHelper.Invalid(solvedPath[i + 1]))
                {
                    reset = true;

                    return;
                }
                Debug.DrawLine(solvedPath[i].Position, solvedPath[i + 1].Position, Color.cyan * new Color(1.0f, 1.0f, 1.0f, 0.5f));
            }
        }