Based on the context provided, here are the methods available for masking parts of a skeleton in Unity:
Using SpriteMask with SkeletonAnimation
SpriteMask is supported for SkeletonAnimation and SkeletonMecanim components. Make sure you're:
- Using a recent version of the spine-unity runtime
- Applying the SpriteMask to non-UI skeleton components (not SkeletonGraphic)
You can find an example scene at Spine Examples/Other Examples/SpriteMask and RectMask2D.unity that demonstrates this setup.
Using RectMask2D with SkeletonGraphic
If you're using SkeletonGraphic (UI-based), you should use RectMask2D instead of SpriteMask. The shaders used by SkeletonGraphic support Unity's RectMask2D component.
More details are available in this blog post: http://esotericsoftware.com/blog/Unity-SpriteMask-and-RectMask2D-support
If none of these solutions work for your specific use case, could you provide more details about what you're trying to achieve? There might be an alternative approach that doesn't require special masking at all.