[2D] How does Graphics.DrawMesh know unit size?

I am rendering everything with Graphics.DrawMesh because I work in ECS. But how does Graphics.DrawMesh function “knows” that my textures are 64x64 and draws them properly, I tried rendering image 256x256 and it’s the same size as 64x64 ones why?

I’m not entirely sure I understand what you’re asking. However to me that sounds like you have trouble understanding how texture mapping works in the first place. A mesh is made of vertices and triangles between those vertices. Each vertex can have, besides the position in space, a texture coordinate which defines which part of the texture should be mapped to this vertex. Vertex coordinates are normalized coordinates and are always relative to the whole texture. So they are in the range 0 to 1 where the point (0, 0) represents the bottom left corner of the texture and (1, 1) represents the top right corner of the texture.

When a mesh is created in a modelling software the artist needs to create those texture coordinates. This is called “unwrapping” since the surface of an object is essentially flattened onto the texture. The size of the texture is irrelevant since the texture coordinates are normalized coordinates. If you want to see what your UV coordinates look like I’ve created this UVViewer editor window. Though It only works when you select an actual gameobject in the scene with a MeshRenderer / SkinnedMeshRenderer.