Exemplo n.º 1
0
    //Create wall between the current cell and the other cell, called if other cell is null
    void CreateWall(Cell cell, Cell otherCell, MapDirection dir)
    {
        //Instantiate a wall on the correct side of the cell
        MapWall wall = Instantiate(wallPrefab) as MapWall;

        wall.Initialise(cell, otherCell, dir);
        //Instantiate a wall on the opposite side of the other cell if it isn't null
        if (otherCell != null)
        {
            wall = Instantiate(wallPrefab) as MapWall;
            wall.Initialise(otherCell, cell, dir.GetOpposite());
        }
    }