mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 18:56:54 +08:00
[unity] Fix default mesh bounds check.
This commit is contained in:
parent
da0132b333
commit
e781ad9ccd
@ -107,8 +107,8 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const float BoundsMinDefault = float.MaxValue;
|
const float BoundsMinDefault = float.PositiveInfinity;
|
||||||
const float BoundsMaxDefault = float.MinValue;
|
const float BoundsMaxDefault = float.NegativeInfinity;
|
||||||
|
|
||||||
[NonSerialized] readonly ExposedList<Vector3> vertexBuffer = new ExposedList<Vector3>(4);
|
[NonSerialized] readonly ExposedList<Vector3> vertexBuffer = new ExposedList<Vector3>(4);
|
||||||
[NonSerialized] readonly ExposedList<Vector2> uvBuffer = new ExposedList<Vector2>(4);
|
[NonSerialized] readonly ExposedList<Vector2> uvBuffer = new ExposedList<Vector2>(4);
|
||||||
@ -940,7 +940,7 @@ namespace Spine.Unity {
|
|||||||
mesh.uv = ubi;
|
mesh.uv = ubi;
|
||||||
mesh.colors32 = cbi;
|
mesh.colors32 = cbi;
|
||||||
|
|
||||||
if (meshBoundsMin.x == BoundsMinDefault) {
|
if (float.IsInfinity(meshBoundsMin.x)) { // meshBoundsMin.x == BoundsMinDefault // == doesn't work on float Infinity constants.
|
||||||
mesh.bounds = new Bounds();
|
mesh.bounds = new Bounds();
|
||||||
} else {
|
} else {
|
||||||
//mesh.bounds = ArraysMeshGenerator.ToBounds(meshBoundsMin, meshBoundsMax);
|
//mesh.bounds = ArraysMeshGenerator.ToBounds(meshBoundsMin, meshBoundsMax);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user