Skip to content

Commit

Permalink
fix compilation error on 2020.x
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Mar 4, 2024
1 parent 28e797c commit 1a7b29f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Runtime/Plugins/GLTFSerialization/Schema/MeshPrimitive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public static int[] GenerateLineLoop(int vertCount)
arr[i] = i;
}

arr[^1] = 0;
arr[arr.Length - 1] = 0;
return arr;
}

Expand Down
4 changes: 2 additions & 2 deletions Runtime/Scripts/SceneImporter/ImporterMeshes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,10 +1144,10 @@ protected void ConvertAttributeAccessorsToUnityTypes(
switch (unityData.DrawModes[indexOffset])
{
case DrawMode.LineLoop:
if (indices[^1] != indices[0])
if (indices[indices.Length - 1] != indices[0])
{
Array.Resize(ref indices, indices.Length + 1);
indices[^1] = indices[0];
indices[indices.Length - 1] = indices[0];
}
break;
case DrawMode.Triangles:
Expand Down

0 comments on commit 1a7b29f

Please sign in to comment.