Browse Source

[unity] Fix SkeletonGraphic.OverrideTexture.

pharan 8 years ago
parent
commit
02d1bfc465

+ 9 - 2
spine-unity/Assets/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs

@@ -122,11 +122,18 @@ namespace Spine.Unity {
 
 
 		#region Internals
 		#region Internals
 		// This is used by the UI system to determine what to put in the MaterialPropertyBlock.
 		// This is used by the UI system to determine what to put in the MaterialPropertyBlock.
-		public Texture OverrideTexture { get; set; }
+		Texture overrideTexture;
+		public Texture OverrideTexture {
+			get { return overrideTexture; }
+			set {
+				canvasRenderer.SetTexture(value);
+				overrideTexture = value;
+			}
+		}
 		public override Texture mainTexture {
 		public override Texture mainTexture {
 			get { 
 			get { 
 				// Fail loudly when incorrectly set up.
 				// Fail loudly when incorrectly set up.
-				if (OverrideTexture != null) return OverrideTexture;
+				if (overrideTexture != null) return overrideTexture;
 				return skeletonDataAsset == null ? null : skeletonDataAsset.atlasAssets[0].materials[0].mainTexture;
 				return skeletonDataAsset == null ? null : skeletonDataAsset.atlasAssets[0].materials[0].mainTexture;
 			}
 			}
 		}
 		}