Skip to content

Commit

Permalink
fix(meshutils): GetUsedUVComponents should now be able to return zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Whinarn committed Apr 30, 2020
1 parent e6f7925 commit af60914
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Runtime/Utility/MeshUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,13 @@ public static int GetUsedUVComponents(List<Vector4> uvs)
if (uvs == null || uvs.Count == 0)
return 0;

int usedComponents = 1;
int usedComponents = 0;
foreach (var uv in uvs)
{
if (usedComponents < 1 && uv.x != 0f)
{
usedComponents = 1;
}
if (usedComponents < 2 && uv.y != 0f)
{
usedComponents = 2;
Expand Down

0 comments on commit af60914

Please sign in to comment.