예제 #1
0
파일: Mover.cs 프로젝트: frms/game-jams
    public int findNextUnoccupiedNode(Vector2 pos)
    {
        int i = currentPath.getClosestSegement(pos);

        for (; i < currentPath.Length; i++)
        {
            int[] mapCoords = Map.map.worldToMapPoint(currentPath[i]);

            if (Map.map.getObj(mapCoords) == null)
            {
                break;
            }
        }

        return(i);
    }