I tried to render tiles and other stuff from script and discovered the next problem that I cannot fix: relative position & size of the sprites on the screen are correct only with precise value of Camera.size.
A few examples:
Camera.size = 5. Almost correct. No gaps between tiles.
Camera.size = 7. Incorrect. Tiles are on the same positions but they are smaller, so there are big gaps between tiles.
My low-level code for rendering:
sprite = Sprite.Create(texture, rectInTexture, new Vector2(.5f, .5f));
...
sprite.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(p.x, p.y, 0f);
...
sprite.transform.localScale = new Vector3(scale.x, scale.y, 1f);
So I want to figure out how to make so that different values of orthographic size would not change the relative position and scale of sprites.
Thanks in advance.

