370688 написалAnd...after Build ...is
You assign a shader programmatically here:
render.material.shader = Shader.Find("Spine/Outline/Skeleton");
Unity has no chance to know that it should include the shader in your build if there is nothing referencing it.
You have to add it to the Always included shaders
:
https://docs.unity3d.com/2019.3/Documentation/Manual/class-GraphicsSettings.html
370688 написалHello, I didn't solve the problem, but I found it.
I think you did misunderstand how the material override concept works.
Your code does not work since you override the material with itself instead of with an outline material version. Furthermore you set the override in void Start()
instead of when the mouse button is pressed:
ani.CustomMaterialOverride[render.sharedMaterial] = Material.Instantiate(render.sharedMaterial);//
And when the mouse button is pressed, you modify the Renderer's material instead of setting the override:
if (Input.GetMouseButtonDown(0))
{
render.material.shader = Shader.Find("Spine/Outline/Skeleton");
...
}
Here you should have set the custom material override, overriding the normal material with an outline version of the material.