Hey,
I try to change the material on my Spine Enemy. To achieve that I found here in the forum to use the SkeletonRendererCustomMaterials. So, I added this component plus added the original Material and the new Material to the first list entry of the CustomMaterialOverrides List.
When I use the bool in the inspector "Override Disabled" it does exactly what I want. It changes the materials back and forth (true/false).
But now I am not able to access exactly this function via code. I tried to get this component(SkeletonRendererCustomMaterials) using the needed namespace but I am not sure why I can't access this bool.
I somehow guess this is not the way this is intended and therefore this is somehow protected. But it seems so easier via the inspector.
Is there anything you can recommend?
Thank you very much!
Using Spine 3.6.5 and the corresponding runtimes.
I would like to add an additional question. When the material is changed to the override material (Skeleton PMA Screen) I would like to change the Tint Color via code.
But this here does not do a thing:
myMeshRenderer.material.SetColor("_Color", new Color(1,0,0,0));
I also tried it this way:
myMeshRenderer.material.color = new Color(1,0,0,0);
If I use debug.log to get info about Color like this:
Debug.Log("Change Color: Current color is: " + myMeshRenderer.material.color);
I get the right values so I guess I have the right material and the right attribute on the shader.
Do you have any ideas?