mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
Fixed flickering with multi page atlases and animated attachment changes.
This commit is contained in:
parent
c4a3de0e7f
commit
43ce1c3dff
@ -273,6 +273,13 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
submesh.indexCount = 0;
|
submesh.indexCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Last submesh may have more indices than required, so zero indexes to the end.
|
||||||
|
if (lastSubmesh && submesh.indexCount != indexCount) {
|
||||||
|
submesh.indexCount = indexCount;
|
||||||
|
for (int i = indexCount, n = indexes.Length; i < n; i++)
|
||||||
|
indexes[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Set indexes if not already set.
|
// Set indexes if not already set.
|
||||||
if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {
|
if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {
|
||||||
submesh.indexCount = indexCount;
|
submesh.indexCount = indexCount;
|
||||||
@ -286,13 +293,6 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
indexes[i + 5] = vertexIndex + 1;
|
indexes[i + 5] = vertexIndex + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last submesh may have more indices than required, so zero indexes to the end.
|
|
||||||
if (lastSubmesh && submesh.indexCount != indexCount) {
|
|
||||||
submesh.indexCount = indexCount;
|
|
||||||
for (int i = indexCount, n = indexes.Length; i < n; i++)
|
|
||||||
indexes[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnEnable () {
|
public virtual void OnEnable () {
|
||||||
|
|||||||
@ -273,6 +273,13 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
submesh.indexCount = 0;
|
submesh.indexCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Last submesh may have more indices than required, so zero indexes to the end.
|
||||||
|
if (lastSubmesh && submesh.indexCount != indexCount) {
|
||||||
|
submesh.indexCount = indexCount;
|
||||||
|
for (int i = indexCount, n = indexes.Length; i < n; i++)
|
||||||
|
indexes[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Set indexes if not already set.
|
// Set indexes if not already set.
|
||||||
if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {
|
if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {
|
||||||
submesh.indexCount = indexCount;
|
submesh.indexCount = indexCount;
|
||||||
@ -286,13 +293,6 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
indexes[i + 5] = vertexIndex + 1;
|
indexes[i + 5] = vertexIndex + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last submesh may have more indices than required, so zero indexes to the end.
|
|
||||||
if (lastSubmesh && submesh.indexCount != indexCount) {
|
|
||||||
submesh.indexCount = indexCount;
|
|
||||||
for (int i = indexCount, n = indexes.Length; i < n; i++)
|
|
||||||
indexes[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnEnable () {
|
public virtual void OnEnable () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user