- Modifié
[Unity] Spine animation sorting layer
I would like to place Spine animations between layers that I have set up in Unity.
One example is I have a background sprite with a window in it set up on the sorting layer called "Background" and would like to show a Spine animation through the partly transparent window, which would be placed on the "BehindBackground" sorting layer.
Is this possible?
- Modifié
Spine just generates a mesh and gives it to its MeshRenderer.
Since Unity 4.3, all Unity Renderers (including MeshRenderers) have a bunch of (hidden) sorting layer and sorting order properties or fields or something. They are serialized (ie, saved as part of the renderer data in the prefab or scene) but they're not visible in the Inspector.
There are some tools that allow these hidden properties to be shown in the inspector. One of them is here: https://github.com/nickgravelyn/UnityToolbag
Take a look at the SortingLayer folder. I think it allows you to add SortingLayerExposed component to a GameObject and it'll access that renderer's properties through the inspector. The serialized data is on the renderer itself so you can remove SortingLayerExposed after you're done.
I think in an upcomping Unity 4.x update, they'll expose sorting layer properties in the inspector officially.
Oh, and those properties are also accessible through code.
Ahh great! Thanks very much :-)