• Unity
  • MaterialPropertyBlock

Is it possible to use MaterialPropertyBlock for spine materials? Specifically for materials assigned via CustomSlotMaterials?

And if yes, then how? Normally I'd did something like GetComponent<SpriteRenderer>().SetPropertyBlock(block), but I'm not sure which renderer I am supposed to access in case of spine.

Related Discussions
...
  • Изменено
18 дней спустя

Thanks, but I'm afraid the article doesn't contain all answers to my question. Which I found out after additional research.

One needs to use GetComponent<MeshRenderer>().SetPropertyBlock(block, index), where index is the index of the material in the list of meshrenderer materials visible in unity inspector at runtime after assigning CustomSlotMaterials.

Your observation is correct. Please note that the required submesh count and order (and thus the material order) may change when you change e.g. attachment visibility or draw order.