• Unity
  • Change SortingOrder and OrderInLayer during runtime

  • Düzenlendi
Related Discussions
...

The SortingOrder and OrderInLayer appear to be exposed as public variable in the inspector for the SkeletonAnimation script. However, I cannot manage to access them via any code pulling in the SkeletonAnimation component.

HTTPS desteği olmadığı için görsel kaldırıldı. | Yine de Göster

Does anyone know how to access these in script? I need to change both during runtime for my game.

Those items in the inspector are purely shortcuts to the MeshRenderer's sorting properties.
Just change MeshRenderer's sorting layer and sorting order in code.

Despite being hidden in the inspector, those values are also serialized as part of MeshRenderer's object, not SkeletonAnimation.