// Uvs for normal cube void Uvs(int dir, ushort atlasID, int Index) { if (dir == 4 && atlasID == 0) { } TextureUVHelper uvHelper = texAtlasSettings.GetUVs(atlasID, (TextureAtlasSettings.Dir)dir); for (int u = 0; u < 4; u++) { MeshUv newMeshUV = new MeshUv { uv = uvHelper[u] }; uvs[Index + u] = newMeshUV; } }
public TextureUVHelper GetUVs(ushort id, Dir dir) // mesh gen system uses this { ID atlasId = (ID)id; Vector2 texturePos = GetTextureCoord(atlasId, dir); TextureUVHelper texUVHelper = new TextureUVHelper { pos1 = new float2(texturePos.x * tUnit + tUnit, texturePos.y * tUnit + tUnit), pos2 = new float2(texturePos.x * tUnit, texturePos.y * tUnit + tUnit), pos3 = new float2(texturePos.x * tUnit, texturePos.y * tUnit), pos4 = new float2(texturePos.x * tUnit + tUnit, texturePos.y * tUnit) }; return(texUVHelper); }