//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public static void SetMeshIconCoords(MeshBuilder pMeshBuild, IconOffset pOffset) { Vector2[] uvList = pMeshBuild.Uvs; const float step = 1 / 8f; float offset = step * (int)pOffset; var uvCenter = new Vector2(0.5f, 0.5f); const float cheatToCenterAmount = 0.015f; for (int i = 0; i < uvList.Length; i++) { Vector2 uv = uvList[i]; uv = Vector2.Lerp(uv, uvCenter, cheatToCenterAmount); uv.x *= step; uv.x += offset; pMeshBuild.Uvs[i] = uv; } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public static void SetMeshIconCoords(MeshBuilder pMeshBuild, IconOffset pOffset) { Vector2[] uvList = pMeshBuild.Uvs; const float step = 1/8f; float offset = step*(int)pOffset; var uvCenter = new Vector2(0.5f, 0.5f); const float cheatToCenterAmount = 0.015f; for ( int i = 0 ; i < uvList.Length ; i++ ) { Vector2 uv = uvList[i]; uv = Vector2.Lerp(uv, uvCenter, cheatToCenterAmount); uv.x *= step; uv.x += offset; pMeshBuild.Uvs[i] = uv; } }