
When these pregenerated materials can not be found, for example because they were deleted via the Advanced section, copies of the default materials are created on-the-fly. When changing the Mask Interaction mode at runtime, the component will use the pregenerated materials if available. If the material is not present or has been deleted, it is generated again based on the default material. The Set button lets you reassign a link to the respective material to prepare them for runtime use.Note that other SkeletonAnimation components on other game objects might still reference the materials. The Delete button lets you clear the reference to the material and delete the underlying asset.The Clear button lets you clear references to unneeded materials.You can manage and optimize the generated materials via the Advanced section of the SkeletonAnimation component: This allows sharing the materials between many component instances and reduces overhead from generating materials on-the-fly at runtime. These additional material assets use the file suffixes _InsideMask and _OutsideMask, and are placed in the same folder as the original materials.īy default, a Skeleton Animation component keeps references to all generated materials. When switching mask interaction modes in the inspector outside of Play mode, additional material assets are generated for the respective Stencil Compare parameters.

Visible Outside Mask: The sprite will be visible only in areas where a mask is not present.Visible Inside Mask: The sprite will be visible only in areas where a mask is present.None: The sprite will not interact with the masking system.

The following mask interaction modes are supported: The SkeletonAnimation and SkeletonMecanim components now provide an additional Mask Interaction field in the inspector, mirroring the same mask interaction modes available in Unity's built-in SpriteRenderer component:

It can be used to restrict Unity UI SkeletonGraphic objects to a rectangular area with better performance versus using a masking image. It supports all shaders shipped with the spine-unity runtime out of the box.Ī rect mask is a masking control similar to the sprite mask control. This feature is implemented for both the SkeletonAnimation and SkeletonMecanim components. We are happy to announce support for Unity sprite masks and Unity UI rect masks in our spine-unity runtime!Ī sprite mask can be used to either hide or reveal parts of a skeleton or group of skeletons based on a masking image.
