diff --git a/spine-unity/Assets/spine-unity/Mesh Generation/SpineMesh.cs b/spine-unity/Assets/spine-unity/Mesh Generation/SpineMesh.cs index 978b9b9ee..14efdeecf 100644 --- a/spine-unity/Assets/spine-unity/Mesh Generation/SpineMesh.cs +++ b/spine-unity/Assets/spine-unity/Mesh Generation/SpineMesh.cs @@ -107,8 +107,8 @@ namespace Spine.Unity { } } - const float BoundsMinDefault = float.MaxValue; - const float BoundsMaxDefault = float.MinValue; + const float BoundsMinDefault = float.PositiveInfinity; + const float BoundsMaxDefault = float.NegativeInfinity; [NonSerialized] readonly ExposedList vertexBuffer = new ExposedList(4); [NonSerialized] readonly ExposedList uvBuffer = new ExposedList(4); @@ -940,7 +940,7 @@ namespace Spine.Unity { mesh.uv = ubi; 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(); } else { //mesh.bounds = ArraysMeshGenerator.ToBounds(meshBoundsMin, meshBoundsMax);