Ejemplo n.º 1
0
    // CREATE WALL:
    private void CreateWall(MazeCell cell, MazeCell otherCell, MazeDirection direction)
    {
        MazeWall wall;

        direction.GetDirection();

        if (direction.GetDirection() == MazeDirection.North)
        {
            wall = Instantiate(NorthWall) as MazeWall;
            wall.Initialize(cell, otherCell, direction);
        }

        else if (direction.GetDirection() == MazeDirection.South)
        {
            wall = Instantiate(SouthWall) as MazeWall;
            wall.Initialize(cell, otherCell, direction);
        }

        else if (direction.GetDirection() == MazeDirection.East)
        {
            wall = Instantiate(EastWall) as MazeWall;
            wall.Initialize(cell, otherCell, direction);
        }

        else if (direction.GetDirection() == MazeDirection.West)
        {
            wall = Instantiate(WestWall) as MazeWall;
            wall.Initialize(cell, otherCell, direction);
        }

        /*if (otherCell != null) {
         *      wall = Instantiate(wallPrefab) as MazeWall;
         *      wall.Initialize(otherCell, cell, direction.GetOpposite());
         * }*/
    }