• RuntimesUnityBugs
  • SkeletonRenderTexture.cs doesn't work in Build

Using macOS Ventura, latest Unity 2022.3.5f1, latest Spine runtime 2023-06-27.

I'm trying to use SkeletonRenderTexture.cs to set transparency of a spine object.
Issue: leaving the “Quad Material” empty in the SkeletonRenderTexture.cs will work in the Editor (the spine object receives the desired color, e.g. reduced transparency etc…), but the color changes won’t show in the build version.
Fix: Insert the “RenderQuadMaterial” (located in Spine Examples > Scripts > SkeletonRenderTexture) or any material, it will now work in build too.

It was confusing since I wondered why it works in Editor but not Build. It’s either a bug or there should be a warning “Don't forget to se Quad Material to work in build”.
I know it’s just an example script, but I’m bad with code and I needed this script :p
My guess is line 93: ... quadMeshRenderer.material = new Material(Shader.Find("Spine/RenderQuad"));
... that’s messing in build versions…

  • Harald ответили на это сообщение.
    Related Discussions
    ...
    • Изменено

    PeterBacall Any shaders that are not referenced by your scene assets need to be added to the Always Included Shaders in the Project Settings under Graphics. Otherwise the shader counts as unused and is not included in the build.

    We have changed the example component so that this material is assigned automatically in the editor upon component creation and reset. It will be released with the next package update. Thanks for bringing this to our attention!