• Unity
  • Addressing separate layers of Spine scene

Hello!

New user, and please excuse the (possibly) newbie question! 😃


We are looking at a fundamental decision for how to handle animated scenes in a large game project. The game will have many scenes, possibly more than 100. Each scene would be 1 Spine object.

The scenes consist of a static background, with several animated objects on top.

We would like to reveal a number of layers (sub-objects) in the Spine scene, but reveal them one at a time. We don't want to animate this in Spine using e.g. opacity, but rather, we would like to use our own de-masking shader effect from the shadergraph.
Is it possible for us to target individual layers within the Spine scene from Unity code so that we could apply our shader like this?

We are still new to Spine, but our initial investigation points to this not being possible, because individual sub-objects in a Spine object (scene) cannot be addressed via script, and hence the shader can’t be applied / triggered individually.

Is this correct (ie what I’m describing would not be possible), or is there an obvious workaround which we’re missing?

Thank you!
-RasmusKeldorff

Related Discussions
...

Hi and welcome to Spine!

There should be multiple possible ways to achieve your goal. You can set a custom material per Slot (which might be the easiest solution) or set an override material to replace one material with another, as is described here on the spine-unity documentation page:
spine-unity Runtime Documentation: Changing Materials Per Instance
A suitable workflow could be to group attachments and pack them per layer to a single atlas page first, which will generate a Material for this atlas page. Then you could customize or override this material accordingly to use your custom shader.

The simplest solution however might be to have a single Spine skeleton per layer. What would be the best option will depend on your actual use case.

Excellent answer, we have several things to go on here.

I might be back later with questions 🙂

Thanks!

RasmusKeldorff yazdı

Excellent answer, we have several things to go on here.

Thanks for your kind words, glad it helped. 🙂

RasmusKeldorff yazdı

I might be back later with questions 🙂

Thanks for the warning, we will prepare accordingly. 😉