示例#1
0
 private void ConnectSquareToNeighbors(GridSquare square)
 {
     foreach (Vector3Int dir in Directions)
     {
         Vector3Int nPos     = square.Position + dir;
         GridSquare neighbor = Get(nPos);
         if (neighbor != null)
         {
             square.AddNeighbor(neighbor);
             neighbor.AddNeighbor(square);
         }
     }
 }