Ejemplo n.º 1
0
    public bool OverlapCheck(Vector3Int stonePosition)
    {
        bool      overlaps  = false;
        NodeGroup nodeGroup = pathfinder.nodeGroup;

        for (int x = stonePosition.x - 1; x < stonePosition.x + 1; x++)
        {
            for (int y = stonePosition.y - 1; y < stonePosition.y + 1; y++)
            {
                if (nodeGroup.GetNode(x, y).isBuildable == false)
                {
                    overlaps = false;
                    break;
                }
                else
                {
                    overlaps = true;
                }
            }

            if (overlaps == false)
            {
                break;
            }
        }

        return(overlaps);
    }
Ejemplo n.º 2
0
 public List <Vector3> FindPath(int startNodeX, int startNodeY, int endNodeX, int endNodeY)
 {
     return(FindPath(nodeGroup.GetNode(startNodeX, startNodeY), nodeGroup.GetNode(endNodeX, endNodeY)));
 }