浏览代码

[unity] Fixed disabling SkeletonGraphic outside bounds of RectMask2D displaying SkeletonSubmeshGraphic incorrectly. Closes #2324.

Harald Csaszar 2 年之前
父节点
当前提交
7b37dd5f7b

+ 10 - 0
spine-unity/Assets/Spine/Runtime/spine-unity/Components/Internal/SkeletonSubmeshGraphic.cs

@@ -43,5 +43,15 @@ namespace Spine.Unity {
 		protected override void OnPopulateMesh (VertexHelper vh) {
 			vh.Clear();
 		}
+
+		protected override void OnDisable () {
+			base.OnDisable();
+			this.canvasRenderer.cull = true;
+		}
+
+		protected override void OnEnable () {
+			base.OnEnable();
+			this.canvasRenderer.cull = false;
+		}
 	}
 }