コード例 #1
0
    private Tile SelectPadTile(Vector2Int loc, int[,] padGrid)
    {
        int[,] neighbours = GridMath.GetNeighbours(padGrid, loc);
        string gridType = GridMath.Comparison(neighbours, GridMath.PadComparisonGrids, 1);

        if (gridType != null)
        {
            return(_padTiles[gridType]);
        }

        return(_wallTiles["wall"]);
    }
コード例 #2
0
    private Tile SelectWallTile(Vector2Int loc, int[,] collideGrid)
    {
        int[,] neighbours = GridMath.GetNeighbours(collideGrid, loc);
        string gridType = GridMath.Comparison(neighbours, GridMath.WallComparisonGrids);

        if (gridType != null)
        {
            return(_wallTiles[gridType]);
        }

        return(_wallTiles["wall"]);
    }