setTile() public static method

public static setTile ( int _x, int _y, int _value ) : void
_x int
_y int
_value int
return void
    public void setup()
    {
        transform.position = new Vector3((int)transform.position.x, (int)transform.position.y, (int)transform.position.z);

        transform.position = new Vector3(transform.position.x - (transform.localScale.x / 2), transform.position.y, transform.position.z - (transform.localScale.z / 2));

        for (int i = (int)transform.position.x; i < (int)transform.position.x + transform.localScale.x; i++)
        {
            for (int j = (int)transform.position.z; j < (int)transform.position.z + transform.localScale.z; j++)
            {
                BSPTree.setTile(i, j, 1);
            }
        }

        for (int i = 0; i < transform.localScale.x + 1; i++)
        {
            BSPTree.setTile((int)transform.position.x + i, (int)transform.position.z, 2);
            BSPTree.setTile((int)transform.position.x + i, (int)(transform.position.z + transform.localScale.z), 2);
        }

        for (int i = 0; i < transform.localScale.z + 1; i++)
        {
            BSPTree.setTile((int)transform.position.x, (int)transform.position.z + i, 2);
            BSPTree.setTile((int)(transform.position.x + transform.localScale.x), (int)transform.position.z + i, 2);
        }
    }
    private void updateTile()
    {
        BSPTree.setTile((int)transform.position.x, (int)transform.position.z, 1);
        BSPTree.setTile((int)transform.position.x + 1, (int)transform.position.z, 1);
        BSPTree.setTile((int)transform.position.x - 1, (int)transform.position.z, 1);
        BSPTree.setTile((int)transform.position.x, (int)transform.position.z + 1, 1);
        BSPTree.setTile((int)transform.position.x, (int)transform.position.z - 1, 1);

        surroundTilesWithWall((int)transform.position.x + 1, (int)transform.position.z);
        surroundTilesWithWall((int)transform.position.x - 1, (int)transform.position.z);
        surroundTilesWithWall((int)transform.position.x, (int)transform.position.z + 1);
        surroundTilesWithWall((int)transform.position.x, (int)transform.position.z - 1);
    }
    public void surroundTilesWithWall(int _x, int _y)
    {
        if (BSPTree.getGrid().getTile(_x + 1, _y) == 0)
        {
            BSPTree.setTile(_x + 1, _y, 2);
        }

        if (BSPTree.getGrid().getTile(_x - 1, _y) == 0)
        {
            BSPTree.setTile(_x - 1, _y, 2);
        }

        if (BSPTree.getGrid().getTile(_x, _y + 1) == 0)
        {
            BSPTree.setTile(_x, _y + 1, 2);
        }

        if (BSPTree.getGrid().getTile(_x, _y - 1) == 0)
        {
            BSPTree.setTile(_x, _y - 1, 2);
        }
    }