From 9860cc9eff7a7fc597dff001b7c560f2fdf01826 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 3 Jun 2019 14:53:19 +0200 Subject: [PATCH 1/2] [unity] Fixed endless loop in Unity Editor when updating assets due to stencil parameter auto-update. Closes #1371. --- .../Runtime/spine-unity/Components/SkeletonRenderer.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs index 282848b60..307ffd8c9 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs @@ -122,6 +122,9 @@ namespace Spine.Unity { public const UnityEngine.Rendering.CompareFunction STENCIL_COMP_MASKINTERACTION_VISIBLE_INSIDE = UnityEngine.Rendering.CompareFunction.LessEqual; /// Shader property value used as Stencil comparison function for . public const UnityEngine.Rendering.CompareFunction STENCIL_COMP_MASKINTERACTION_VISIBLE_OUTSIDE = UnityEngine.Rendering.CompareFunction.Greater; + #if UNITY_EDITOR + private static bool haveStencilParametersBeenFixed = false; + #endif #endif // #if BUILT_IN_SPRITE_MASK_COMPONENT #endregion @@ -532,8 +535,10 @@ namespace Spine.Unity { #if UNITY_EDITOR private void EditorFixStencilCompParameters() { - if (HasAnyStencilComp0Material()) + if (!haveStencilParametersBeenFixed && HasAnyStencilComp0Material()) { + haveStencilParametersBeenFixed = true; FixAllProjectMaterialsStencilCompParameters(); + } } private void FixAllProjectMaterialsStencilCompParameters() { From 79fea3722ba59cd1bb1a6aef42138e0c3a193086 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 13 Jun 2019 15:15:57 +0200 Subject: [PATCH 2/2] [csharp] Port of commit ccc5b2f: Fixed root bone transform for skeleton scale to use world axes. See #1373. --- spine-csharp/src/Bone.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-csharp/src/Bone.cs b/spine-csharp/src/Bone.cs index 79dcdf5b3..6fb30cf2b 100644 --- a/spine-csharp/src/Bone.cs +++ b/spine-csharp/src/Bone.cs @@ -149,8 +149,8 @@ namespace Spine { if (parent == null) { // Root bone. float rotationY = rotation + 90 + shearY, sx = skeleton.scaleX, sy = skeleton.scaleY; a = MathUtils.CosDeg(rotation + shearX) * scaleX * sx; - b = MathUtils.CosDeg(rotationY) * scaleY * sy; - c = MathUtils.SinDeg(rotation + shearX) * scaleX * sx; + b = MathUtils.CosDeg(rotationY) * scaleY * sx; + c = MathUtils.SinDeg(rotation + shearX) * scaleX * sy; d = MathUtils.SinDeg(rotationY) * scaleY * sy; worldX = x * sx + skeleton.x; worldY = y * sy + skeleton.y;