mulot

Hello,

I'm a very new user to both Spine and Unity so I might make a small and stupid mistake for you, but I'm totally unable to find it by myself...

I want to use the "tint black" in runtime, (here's a screenshot of what I'm calling "tint black", so I'm sure it's the good thing ?)

Here is the code I'm using :
public void changecolorfromtriggers()
{
var tmp2 = skeletonData2.FindSlot("FEMALE TORSO BLACK SHADOW SLOT");

tmp2.HasSecondColor = true;

tmp2.A = privateSliderA1.value;
tmp2.R = privateSliderR1.value;
tmp2.G = privateSliderG1.value;
tmp2.B = privateSliderB1.value;

tmp2.R2 = privateSliderR2.value;
tmp2.G2 = privateSliderG2.value;
tmp2.B2 = privateSliderB2.value;

skeleton2.SetSlotsToSetupPose();
}
The first part is working well (the color is modified, the alpha too), but it looks like the second part is not working... It's litteraly doing nothing, though I'm using the same values as in Spine... Am I doing something wrong ? Could you please give a little help ?

Thanks in advance ! :)

Cédric

edit : the skeleton2 and skeletonData2 declarations are done elsewhere in the code, but I assume they are working since A,R,G,B values are modified. The only one not working are R2,G2,B2
No tienes los permisos requeridos para ver los archivos adjuntos a este mensaje.
mulot
  • Mensajes: 5

Harald

Please note that in order for "tint black" to work, you have to
1. Use one of the TintBlack spine-unity shaders.
2. At the SkeletonAnimation component, enable the Tint Black parameter under Advanced, as described here. This is necessary to pass the additional vertex data to the shader.

I would assume that you missed the second part here.
Avatar de Usuario
Harald

Harri
  • Mensajes: 1727

mulot

Hello Harald and thank you for your very fast answer !
First, you're amazing, second, you're quite right and to be honest I was neither doing step 1 nor step 2... As you said I selected the TintBlack shader, enabled the parameter and it now works like a charm !

Thanks again,

Best regards,

Cédric
mulot
  • Mensajes: 5

Harald

Very glad it helped! Thanks for getting back to us and for your kind words! :)
Avatar de Usuario
Harald

Harri
  • Mensajes: 1727


Volver a Unity