void PathfinderCallback(List <Node> p)
        {
            int curAP    = curUnit.GetActionPoint();
            int neededAP = 0;

            List <PathInfo> tp = new List <PathInfo>();
            PathInfo        p1 = new PathInfo();

            p1.ap            = 0;
            p1.targetPositon = curUnit.transform.position;
            tp.Add(p1);

            List <PathInfo> red    = new List <PathInfo>();
            int             baseAP = 2;
            int             diag   = 3; // Mathf.FloorToInt( baseAP / 2)

            if (curUnit.crouch)
            {
                baseAP = 4;
                diag   = 6;
            }
            if (curUnit.prone)
            {
                baseAP = 6;
                diag   = 7;
            }


            for (int i = 0; i < p.Count; i++)
            {
                Node    n   = p[i];
                Vector3 wp  = grid.GetWorldCoordinatesFromNode(n.X, n.Y, n.Z);
                Vector3 dir = Vector3.zero;

                if (i == 0)
                {
                    dir = GetPathDir(curUnit.GetNode, n);
                }
                else
                {
                    dir = GetPathDir(p[i - 1], p[i]);
                }

                if (dir.x != 0 && dir.z != 0)
                {
                    baseAP = diag;
                }

                neededAP += baseAP;

                PathInfo pi = new PathInfo();
                pi.ap            = baseAP;
                pi.targetPositon = wp;

                if (neededAP > curAP)
                {
                    if (red.Count == 0)
                    {
                        red.Add(tp[i]);
                    }

                    red.Add(pi);
                }
                else
                {
                    tp.Add(pi);
                }
            }

            UIManager.instance.UpdateActionPointsIndicator(neededAP);

            pathsInfo = tp;
            redInfo   = red;
            hasPath   = true;
        }