Ejemplo n.º 1
0
 public void PrintMap(Transform prefabWalkable, Transform prefabUnwalkable)
 {
     for (int x = 0; x < mapNodes.Length; x++)
     {
         for (int y = 0; y < mapNodes[x].Length; y++)
         {
             PathNode pathNode = mapNodes[x][y];
             UnityEngine.Object.Instantiate(pathNode.IsWalkable() ? prefabWalkable : prefabUnwalkable, new Vector3(x * nodeSize, y * nodeSize), Quaternion.identity);
         }
     }
 }
Ejemplo n.º 2
0
 public void PrintMap(Action <int, int> printWalkable, Action <int, int> printUnwalkable)
 {
     for (int x = 0; x < mapNodes.Length; x++)
     {
         for (int y = 0; y < mapNodes[x].Length; y++)
         {
             PathNode pathNode = mapNodes[x][y];
             if (pathNode.IsWalkable())
             {
                 printWalkable(x, y);
             }
             else
             {
                 printUnwalkable(x, y);
             }
         }
     }
 }