Browse Source

[unity] Fixed keyword not being set for SkeletonGraphicRenderTexture quad material. See #2520.

Harald Csaszar 1 year ago
parent
commit
a177da9611

+ 3 - 2
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonRenderTexture/RenderQuadGraphicMaterial.mat

@@ -11,7 +11,8 @@ Material:
   m_Shader: {fileID: 4800000, guid: fa95b0fb6983c0f40a152e6f9aa82bfb, type: 3}
   m_Parent: {fileID: 0}
   m_ModifiedSerializedProperties: 0
-  m_ValidKeywords: []
+  m_ValidKeywords:
+  - _CANVAS_GROUP_COMPATIBLE
   m_InvalidKeywords:
   - _ALPHAPREMULTIPLY_ON
   - _USE8NEIGHBOURHOOD_ON
@@ -64,7 +65,7 @@ Material:
     m_Ints: []
     m_Floats:
     - _BumpScale: 1
-    - _CanvasGroupCompatible: 0
+    - _CanvasGroupCompatible: 1
     - _ColorMask: 15
     - _Cutoff: 0.5
     - _DarkColorAlphaAdditive: 0

+ 3 - 1
spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonRenderTexture/SkeletonGraphicRenderTexture.cs

@@ -89,8 +89,10 @@ namespace Spine.Unity.Examples {
 			quadMesh.name = "RenderTexture Quad";
 			quadMesh.hideFlags = HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor;
 
-			if (quadMaterial == null)
+			if (quadMaterial == null) {
 				quadMaterial = new Material(Shader.Find("Spine/SkeletonGraphic"));
+				quadMaterial.EnableKeyword("_CANVAS_GROUP_COMPATIBLE");
+			}
 		}
 
 		void Reset () {