[unity] Fixed Mesh bounds computation always including origin. Closes #2701.

This commit is contained in:
Harald Csaszar 2024-11-28 18:17:12 +01:00
parent 13a0a68275
commit fcce08a14a
2 changed files with 5 additions and 3 deletions

View File

@ -1230,9 +1230,11 @@ namespace Spine.Unity {
// Zero the extra.
{
int listCount = vertexBuffer.Count;
Vector3 vector3zero = Vector3.zero;
// unfortunately even non-indexed vertices are still used by Unity's bounds computation,
// (considered a Unity bug), thus avoid Vector3.zero and use last vertex instead.
Vector3 extraVertex = listCount == 0 ? Vector3.zero : vbi[listCount - 1];
for (int i = listCount; i < vbiLength; i++)
vbi[i] = vector3zero;
vbi[i] = extraVertex;
}
// Set the vertex buffer.

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.spine-unity",
"displayName": "spine-unity Runtime",
"description": "This plugin provides the spine-unity runtime core.",
"version": "4.2.89",
"version": "4.2.90",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",