private void BuildConnector(Tile tile1, Tile tile2, Enums.CardinalDirection direction) { TileEdge connector = Instantiate(Resources.Load <GameObject>("Blocks/Connector")).GetComponent <TileEdge>(); connector.InitializeEdge(tile1, tile2, direction); connector = Instantiate(Resources.Load <GameObject>("Blocks/Connector")).GetComponent <TileEdge>(); connector.InitializeEdge(tile2, tile1, direction.GetOpposite()); }
private void BuildWall(Tile tile1, Tile tile2, Enums.CardinalDirection direction) { TileEdge wall = Instantiate(Resources.Load <GameObject>("Blocks/Wall")).GetComponent <TileEdge>(); wall.InitializeEdge(tile1, tile2, direction); if (tile2 != null) { wall = Instantiate(Resources.Load <GameObject>("Blocks/Wall")).GetComponent <TileEdge>(); wall.InitializeEdge(tile2, tile1, direction.GetOpposite()); } }
public void SetEdge(Enums.CardinalDirection direction, TileEdge edge) { this.edges[(int)direction] = edge; this.initializedEdgeCount += 1; }