Пример #1
0
        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());
        }
Пример #2
0
        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());
            }
        }
Пример #3
0
 public void SetEdge(Enums.CardinalDirection direction, TileEdge edge)
 {
     this.edges[(int)direction] = edge;
     this.initializedEdgeCount += 1;
 }