• Unity
  • tint:black, how to use it ?

  • Modifié
Related Discussions
...

Hello

I'm a bit confused with the usage of tint black , in spine I set a tint:black and I get the expcted result on my model :


However in unity it doesn't seem to do anything, I tried to change the shader from skeleton to skeleton tint:back but then it just erase all the color for all the animations.

I'm not sure if I did use it properly, tips are welcome 🙂

6 jours plus tard

Thanks, it helped me sorting it out 🙂

5 mois plus tard

Hi Pharan 🙂
about the "incorrect setup" part:
I tried entering and exiting play mode, and i still get rainbow colored mesh instead of the actual colors. reimporting also didnt work.
could you please elaborate on that part?
many thanks! :p

I followed the steps but i still get that rainbow pallete instead of the original colors :S

That should be correct.

Can you send us your Spine export files to check what's wrong?

You can send to unity@esotericsoftware.com

Nothing seems to be wrong.

I did this:

  1. Add the Spine exports to the Unity project. (Spine-Unity will generate the SkeletonData and Atlas assets)
  2. Instantiate the skeleton into the scene.
  3. Open Advanced... and check Tint Black.
  4. Change the Shader to Spine/Skeleton Tint Black
  5. Enter play mode. Play any of the animations.
    No rainbow in the scene.

Note that the Material preview will look wrong as in your screenshot because the preview meshes it uses (cube, sphere, quad, cylinder) does not have its black tint channels (uv1, uv2) filled.

I tried it in a completely new scene and it worked O_O
We will solve the issue we have in our scene and let you know what it was all about.
Maybe it will help other people that encounter the same issue 🙂

Thanks a lot!
Shachar

7 ans plus tard

How can you change the second color through code in Unity?

  • Nate a répondu à ça.

    Thank you. That worked. For others sake, here is an example of what I did:

    Color color = Color.red;
    Color outlineColor = Color.blue;
    
    slot.SetColor(color);
    if (slot.HasSecondColor)
    {
        slot.R2 = outlineColor.r;
        slot.G2 = outlineColor.g;
        slot.B2 = outlineColor.b;
    }

    Can you explain why there isn't simply something like Slot.SetColor(color, darkColor)?

    Also, this is off topic, but where is the Unity API documentation? For instance, I can't seem to find a page documenting specifically the spine-unity Slot class or Slot.SetColor() method.

      So, https://esotericsoftware.com/spine-api-reference, is really all we get for spine-unity API documentation?

      There's really nothing better?

      For instance:

      • The portion for the Slot (class?) makes no mention of the Slot.SetColor() method. Where in this API reference should I find that. For that matter, other than this forum, Stack Overflow, or code hinting, how am I supposed to discover the Slot.SetColor() method?
      • The same for the properties mentioned by @Nate, R2, G2, and B2. How is anyone supposed to guess that those are related to the Tint black feature?
      • Instead color and darkColor properties are listed. (Exactly the properties I want to change, I think, BUT those are NOT available in the Slot class provided in spine-unity.

        curiousdustin Ah, sorry for the oversight about the Slot.SetColor() method not being in the general API reference. It's just that this page is the only documentation that exists independently as an API reference. Runtime-specific methods often require checking the actual source code. Since it is difficult for a small team like ours to keep API documentation summarized by version and updated constantly, the source code descriptions are the most reliable. (The API reference I linked to in my previous reply is also based on the latest version of the Spine Runtimes, and some names may differ from older versions.)

        Documentation for every runtime would of course be better, but so far we have preferred to allocate resources elsewhere, mainly to give you new features. The runtimes are ported faithfully and the API reference covers the majority, at the very least it helps you zero in on where to look in the source code (eg the Slot class). Typically the differences between runtimes are just a few details about lists or how properties are accessed.